hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7903198180dd839a07fa38f93a9fd6887e061f20 | 11,408 | py | Python | setup.py | milter001/transformers | 71846ba7f958f03f816334c8e06e1cd75d17984e | [
"Apache-2.0"
] | 1 | 2021-11-28T08:35:10.000Z | 2021-11-28T08:35:10.000Z | setup.py | PaulLerner/transformers | 6d9e11a1939815910e9274cc1109b632cfa84db4 | [
"Apache-2.0"
] | null | null | null | setup.py | PaulLerner/transformers | 6d9e11a1939815910e9274cc1109b632cfa84db4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The HuggingFace Team. 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 applicabl... | 36.33121 | 233 | 0.673562 |
import os
import re
import shutil
from distutils.core import Command
from pathlib import Path
from setuptools import find_packages, setup
stale_egg_info = Path(__file__).parent / "transformers.egg-info"
if stale_egg_info.exists():
print(
(
"Warning: {} exists.\n\n"
... | true | true |
790319936ac015db09e45b9eac799b3bdf0b0250 | 11,862 | py | Python | python/paddle/fluid/tests/unittests/dygraph_to_static/test_ptb_lm.py | laipaang/Paddle | d7f35434b761707a8479b75636546a624399369a | [
"Apache-2.0"
] | 3 | 2021-06-11T06:48:10.000Z | 2021-09-02T10:18:06.000Z | python/paddle/fluid/tests/unittests/dygraph_to_static/test_ptb_lm.py | MaJun-cn/Paddle | 0ec3a42e9740a5f5066053bb49a923d538eba24a | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/dygraph_to_static/test_ptb_lm.py | MaJun-cn/Paddle | 0ec3a42e9740a5f5066053bb49a923d538eba24a | [
"Apache-2.0"
] | 4 | 2020-07-27T13:24:03.000Z | 2020-08-06T08:20:32.000Z | # Copyright (c) 2018 PaddlePaddle 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 app... | 37.301887 | 80 | 0.581858 |
from __future__ import absolute_import, division, print_function
import logging
import time
import unittest
import numpy as np
import paddle.fluid as fluid
from paddle.fluid.dygraph.dygraph_to_static import ProgramTranslator
from paddle.fluid.dygraph.base import to_variable
from paddle.fluid.dygraph.ji... | true | true |
79031ab3c19a36d606422ffe661ef5b98ac8f980 | 1,010 | py | Python | starthinker/util/salesforce/quickstart.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"Apache-2.0"
] | null | null | null | starthinker/util/salesforce/quickstart.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"Apache-2.0"
] | null | null | null | starthinker/util/salesforce/quickstart.py | quan/starthinker | 4e392415d77affd4a3d91165d1141ab38efd3b8b | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2020 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/l... | 38.846154 | 80 | 0.635644 | true | true | |
79031abb303eeb168d31b045754650487be818de | 12,715 | py | Python | light9/curvecalc/curve.py | drewp/light9 | ab173a40d095051546e532962f7a33ac502943a6 | [
"MIT"
] | 2 | 2018-10-05T13:32:46.000Z | 2022-01-01T22:51:20.000Z | light9/curvecalc/curve.py | drewp/light9 | ab173a40d095051546e532962f7a33ac502943a6 | [
"MIT"
] | 4 | 2021-06-08T19:33:40.000Z | 2022-03-11T23:18:06.000Z | light9/curvecalc/curve.py | drewp/light9 | ab173a40d095051546e532962f7a33ac502943a6 | [
"MIT"
] | null | null | null | import logging, ast, os
from bisect import bisect_left, bisect
import louie as dispatcher
from twisted.internet import reactor
from rdflib import Literal
from light9 import showconfig
from light9.namespaces import L9, RDF, RDFS
from rdfdb.patch import Patch
log = logging.getLogger()
# todo: move to config, consolidate... | 33.025974 | 78 | 0.562407 | import logging, ast, os
from bisect import bisect_left, bisect
import louie as dispatcher
from twisted.internet import reactor
from rdflib import Literal
from light9 import showconfig
from light9.namespaces import L9, RDF, RDFS
from rdfdb.patch import Patch
log = logging.getLogger()
introPad = 4
postPad = 4
class C... | true | true |
79031b38db87921226711c90569e81f01ec8472c | 23,712 | py | Python | nesta/packages/geo_utils/tests/test_geotools.py | anniyanvr/nesta | 4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3 | [
"MIT"
] | 13 | 2019-06-18T16:53:53.000Z | 2021-03-04T10:58:52.000Z | nesta/packages/geo_utils/tests/test_geotools.py | nestauk/old_nesta_daps | 4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3 | [
"MIT"
] | 208 | 2018-08-10T13:15:40.000Z | 2021-07-21T10:16:07.000Z | nesta/packages/geo_utils/tests/test_geotools.py | nestauk/old_nesta_daps | 4b3ae79922cebde0ad33e08ac4c40b9a10e8e7c3 | [
"MIT"
] | 8 | 2018-09-20T15:19:23.000Z | 2020-12-15T17:41:34.000Z | import pandas as pd
from pandas.testing import assert_frame_equal
import pytest
from unittest import mock
from nesta.packages.geo_utils.geocode import geocode
from nesta.packages.geo_utils.geocode import _geocode
from nesta.packages.geo_utils.geocode import geocode_dataframe
from nesta.packages.geo_utils.geocode impor... | 48.195122 | 107 | 0.565494 | import pandas as pd
from pandas.testing import assert_frame_equal
import pytest
from unittest import mock
from nesta.packages.geo_utils.geocode import geocode
from nesta.packages.geo_utils.geocode import _geocode
from nesta.packages.geo_utils.geocode import geocode_dataframe
from nesta.packages.geo_utils.geocode impor... | true | true |
79031bbb2bbfd5f965cf61f9f0adf83d9e6b27a0 | 450 | py | Python | scripts/item/consume_2435553.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/item/consume_2435553.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/item/consume_2435553.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Monster Hot Air Balloon | (2435553)
if sm.getSkillByItem() == 0:# Check whether item has an vehicleID stored, 0 if false.
sm.chat("An Error occurred whilst trying to find the mount.")
elif sm.hasSkill(sm.getSkillByItem()):
sm.chat("You already have the 'Monster Hot Air Balloon' mount.")
else:
sm.consum... | 40.909091 | 86 | 0.708889 |
if sm.getSkillByItem() == 0:
sm.chat("An Error occurred whilst trying to find the mount.")
elif sm.hasSkill(sm.getSkillByItem()):
sm.chat("You already have the 'Monster Hot Air Balloon' mount.")
else:
sm.consumeItem()
sm.giveSkill(sm.getSkillByItem())
sm.chat("Successfully added the 'Monster Hot Ai... | true | true |
79031c7b27d8487b66e06d2009fb12b18b93ae3c | 12,011 | py | Python | scripts/gp_pdf_extractor.py | delenamalan/covid19za | 414a7e0771ebb4b054809f20bff6c4efc0c24ff6 | [
"MIT"
] | null | null | null | scripts/gp_pdf_extractor.py | delenamalan/covid19za | 414a7e0771ebb4b054809f20bff6c4efc0c24ff6 | [
"MIT"
] | 1 | 2020-11-28T15:38:20.000Z | 2020-11-28T15:47:22.000Z | scripts/gp_pdf_extractor.py | delenamalan/covid19za | 414a7e0771ebb4b054809f20bff6c4efc0c24ff6 | [
"MIT"
] | null | null | null | import pdfplumber
import re
import pandas as pd
from datetime import datetime
import sys
# AUTHOR: Simon Rosen
# -----------------------------------
# DEPENDENCIES
# This module requires 'pdfplumber'
#
# Install: pip install pdfplumber
# -----------------------------------
def extract_data(file_path):
... | 40.036667 | 126 | 0.590542 | import pdfplumber
import re
import pandas as pd
from datetime import datetime
import sys
def extract_data(file_path):
pdfp_obj = pdfplumber.open(file_path)
def get_string_between_2_strings(text, string1, string2):
try:
regex_str = string1 + '(.+?)' + string2
... | true | true |
79031d0f20a9f82164968cb1d5d5621862da4894 | 384 | py | Python | run_doctests.py | jtauber/functional-differential-geometry | c3c2eedb378a1610353d99e7f0063993520b8b47 | [
"MIT"
] | 37 | 2015-02-06T11:06:42.000Z | 2021-12-17T23:17:57.000Z | run_doctests.py | jtauber/functional-differential-geometry | c3c2eedb378a1610353d99e7f0063993520b8b47 | [
"MIT"
] | null | null | null | run_doctests.py | jtauber/functional-differential-geometry | c3c2eedb378a1610353d99e7f0063993520b8b47 | [
"MIT"
] | 11 | 2015-02-08T03:22:29.000Z | 2021-12-07T19:08:23.000Z | # this works around a path issue with just calling
# coverage run -m doctest -v <rst-file>
import doctest
import sys
fails = 0
for filename in [
"tuples.rst",
"functions.rst",
"symbolic.rst",
"simplification.rst",
"differentiation.rst",
"symbolic_tuples.rst",
]:
result = doctest.testfile(... | 17.454545 | 50 | 0.661458 |
import doctest
import sys
fails = 0
for filename in [
"tuples.rst",
"functions.rst",
"symbolic.rst",
"simplification.rst",
"differentiation.rst",
"symbolic_tuples.rst",
]:
result = doctest.testfile(filename)
fails += result.failed
if fails:
sys.exit(1)
| true | true |
79031db7333e35f6f952417715791483e7bf8f10 | 23,884 | py | Python | crispy/gui/quanty/calculation.py | jminar/crispy | 560bb11ee1ed03c1151f16a15725390784a38c79 | [
"MIT"
] | 1 | 2021-06-30T13:06:33.000Z | 2021-06-30T13:06:33.000Z | crispy/gui/quanty/calculation.py | jminar/crispy | 560bb11ee1ed03c1151f16a15725390784a38c79 | [
"MIT"
] | null | null | null | crispy/gui/quanty/calculation.py | jminar/crispy | 560bb11ee1ed03c1151f16a15725390784a38c79 | [
"MIT"
] | null | null | null | # coding: utf-8
###################################################################
# Copyright (c) 2016-2020 European Synchrotron Radiation Facility #
# #
# Author: Marius Retegan #
# ... | 31.88785 | 95 | 0.59521 |
occupancy):
key = f"{shell}{occupancy}"
if key in ("s0", "s2", "p0", "p6", "d0", "d10", "f0", "f14"):
particles = "zero"
elif key in ("s1", "p1", "p5", "d1", "d9", "f1", "f13"):
particles = "one"
else:
particles = "multiple"
return particles
... | true | true |
79031e515b9c6be6ec22ecba7a1159a1d4f7ac99 | 849 | py | Python | mainsite/models.py | nandosarracino/mymainsite | 1dbb215e6ec14608e39a9bb913aad35bd97d3429 | [
"MIT"
] | null | null | null | mainsite/models.py | nandosarracino/mymainsite | 1dbb215e6ec14608e39a9bb913aad35bd97d3429 | [
"MIT"
] | null | null | null | mainsite/models.py | nandosarracino/mymainsite | 1dbb215e6ec14608e39a9bb913aad35bd97d3429 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class BaseView(models.Model):
title = models.CharField(max_length=256)
def __unicode__(self):
return self.title
class port1View(models.Model):
def __unicode__(self):
return self.title
class port2View(models.Model):
title = models.CharField(max_length=... | 18.456522 | 41 | 0.762073 | from django.db import models
class BaseView(models.Model):
title = models.CharField(max_length=256)
def __unicode__(self):
return self.title
class port1View(models.Model):
def __unicode__(self):
return self.title
class port2View(models.Model):
title = models.CharField(max_length=256)
def __unicode__(sel... | true | true |
79031ee1f9606392eae10f9c26d2dd5b64be72c6 | 41 | py | Python | sfcsmCtrl/model/__init__.py | chenhui0228/sfcsm | ef9adbc7d2ec8d97cee053678002b65ca41b804b | [
"Apache-2.0"
] | 1 | 2018-06-04T06:26:27.000Z | 2018-06-04T06:26:27.000Z | sfcsmCtrl/model/__init__.py | chenhui0228/sfcsm | ef9adbc7d2ec8d97cee053678002b65ca41b804b | [
"Apache-2.0"
] | null | null | null | sfcsmCtrl/model/__init__.py | chenhui0228/sfcsm | ef9adbc7d2ec8d97cee053678002b65ca41b804b | [
"Apache-2.0"
] | null | null | null | __author__ = 'Alexis.Koalla@orange.com'
| 20.5 | 40 | 0.756098 | __author__ = 'Alexis.Koalla@orange.com'
| true | true |
79031f24504ec4a3d2d8947f9b101ed9a10896e0 | 7,915 | py | Python | benchmark/btb_benchmark/kubernetes.py | dataronio/BTB | 5053ed705cf2542e320e8a7605642f5b01db8272 | [
"MIT"
] | 161 | 2017-12-20T00:17:35.000Z | 2020-11-25T18:18:15.000Z | benchmark/btb_benchmark/kubernetes.py | pvk-developer/BTB | 49d2f3c00881919a23c6578cd02fcfb6f4d33354 | [
"MIT"
] | 162 | 2017-12-26T18:44:38.000Z | 2020-11-19T15:53:03.000Z | benchmark/btb_benchmark/kubernetes.py | pvk-developer/BTB | 49d2f3c00881919a23c6578cd02fcfb6f4d33354 | [
"MIT"
] | 37 | 2018-01-03T09:28:08.000Z | 2020-09-23T10:23:46.000Z | # -*- coding: utf-8 -*-
import argparse
import importlib
import json
import logging
import os
import re
import sys
from io import StringIO
import boto3
import tabulate
import yaml
from dask.distributed import Client
from dask_kubernetes import KubeCluster
from kubernetes.client import Configuration
from kubernetes.cli... | 29.314815 | 97 | 0.637271 |
import argparse
import importlib
import json
import logging
import os
import re
import sys
from io import StringIO
import boto3
import tabulate
import yaml
from dask.distributed import Client
from dask_kubernetes import KubeCluster
from kubernetes.client import Configuration
from kubernetes.client.api import core_v1_... | true | true |
79031fbd015e3fe884659e5cb80d8ca3b0a52a07 | 248 | py | Python | append and delete.py | kasyap1234/codingproblems | 7368222c5fb67b4796410597f68401654878fee0 | [
"MIT"
] | 1 | 2021-04-15T16:09:52.000Z | 2021-04-15T16:09:52.000Z | append and delete.py | kasyap1234/codingproblems | 7368222c5fb67b4796410597f68401654878fee0 | [
"MIT"
] | null | null | null | append and delete.py | kasyap1234/codingproblems | 7368222c5fb67b4796410597f68401654878fee0 | [
"MIT"
] | null | null | null | def appendAndDelete(s, t, k):
iter=0
s=[]
t=[]
while s:
s.pop(0)
iter+=1
for i in t:
s.append(i)
iter+=1
if iter==k:
print("Yes")
else:
print("No")
| 13.052632 | 29 | 0.362903 | def appendAndDelete(s, t, k):
iter=0
s=[]
t=[]
while s:
s.pop(0)
iter+=1
for i in t:
s.append(i)
iter+=1
if iter==k:
print("Yes")
else:
print("No")
| true | true |
7903206627a571e763876f6dde9b116f493b1161 | 47,203 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/api/users_v1_api.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/api/users_v1_api.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/api/users_v1_api.py | erexer/polyaxon | be14dae1ed56d568983388736bcdaf27a7baa4a4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 39.867399 | 89 | 0.569815 |
from __future__ import absolute_import
import re
import six
from polyaxon_sdk.api_client import ApiClient
from polyaxon_sdk.exceptions import ApiTypeError, ApiValueError
class UsersV1Api(object):
def __init__(self, api_client=None):
if api_client is None:
api_clien... | true | true |
790321021ac2785106da737587b334ddfd60d1c0 | 6,688 | py | Python | unified_planning/engines/parallel.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | 9 | 2022-02-18T14:51:58.000Z | 2022-03-31T06:02:43.000Z | unified_planning/engines/parallel.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | 37 | 2022-02-01T10:44:38.000Z | 2022-03-31T09:13:42.000Z | unified_planning/engines/parallel.py | aiplan4eu/unified-planning | d2fd18baa3a2110595e5dfdc3f55254df72c3016 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 AIPlan4EU project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 44.885906 | 170 | 0.638906 |
import warnings
import unified_planning as up
import unified_planning.engines as engines
from unified_planning.plans import Plan
from unified_planning.model import ProblemKind
from unified_planning.exceptions import UPUsageError
from unified_planning.engines.results import LogLevel, PlanGenerationResult... | true | true |
790322b05cee3400c76b80845682fea10cefc3b3 | 351 | py | Python | prompt412/round-101/c.py | honux77/algorithm | 2ed8cef1fbee7ad96d8f2ae583666d52bd8892ee | [
"MIT"
] | 2 | 2019-02-08T01:23:07.000Z | 2020-11-19T12:23:52.000Z | prompt412/round-101/c.py | honux77/algorithm | 2ed8cef1fbee7ad96d8f2ae583666d52bd8892ee | [
"MIT"
] | null | null | null | prompt412/round-101/c.py | honux77/algorithm | 2ed8cef1fbee7ad96d8f2ae583666d52bd8892ee | [
"MIT"
] | null | null | null | def solve(n):
a = []
for _ in range(n):
name, h = input().split()
h = float(h)
a.append((name, h))
a.sort(key = lambda t: t[1], reverse=True)
m = a[0][1]
for n, h in a:
if h != m: break
print(n, end = " ")
print()
while True:
n = int(input())
if ... | 18.473684 | 46 | 0.433048 | def solve(n):
a = []
for _ in range(n):
name, h = input().split()
h = float(h)
a.append((name, h))
a.sort(key = lambda t: t[1], reverse=True)
m = a[0][1]
for n, h in a:
if h != m: break
print(n, end = " ")
print()
while True:
n = int(input())
if ... | true | true |
79032397aef89eafe997e1c467dfa1ed5f356ebb | 745 | py | Python | test/unittests/test_UrbanQTotal.py | rajadain/gwlf-e | ba2fb9dbc08a3d7a4ced4b83b6f0f1307814e2a3 | [
"Apache-2.0"
] | null | null | null | test/unittests/test_UrbanQTotal.py | rajadain/gwlf-e | ba2fb9dbc08a3d7a4ced4b83b6f0f1307814e2a3 | [
"Apache-2.0"
] | null | null | null | test/unittests/test_UrbanQTotal.py | rajadain/gwlf-e | ba2fb9dbc08a3d7a4ced4b83b6f0f1307814e2a3 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from .VariableUnitTest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Discharge import UrbanQTotal
class TestUrbanQTotal(VariableUnitTest):
def test_UrbanQTotal(self):
z = self.z
np.testing.assert_array_almost_equal(
UrbanQTotal.UrbanQTotal_f(z.NYrs, z.DaysMonth,... | 43.823529 | 119 | 0.606711 | import numpy as np
from .VariableUnitTest import VariableUnitTest
from gwlfe.MultiUse_Fxns.Discharge import UrbanQTotal
class TestUrbanQTotal(VariableUnitTest):
def test_UrbanQTotal(self):
z = self.z
np.testing.assert_array_almost_equal(
UrbanQTotal.UrbanQTotal_f(z.NYrs, z.DaysMonth,... | true | true |
790323f724e852cdcf7d4d9d3e4d89703473f768 | 3,725 | py | Python | panel/routes/server.py | emilio2hd/pz-panel | 6b53f465b2c041e963e2b75e48b1612549ad6fea | [
"MIT"
] | null | null | null | panel/routes/server.py | emilio2hd/pz-panel | 6b53f465b2c041e963e2b75e48b1612549ad6fea | [
"MIT"
] | null | null | null | panel/routes/server.py | emilio2hd/pz-panel | 6b53f465b2c041e963e2b75e48b1612549ad6fea | [
"MIT"
] | null | null | null | import glob
import time
from os import path
from flask import Blueprint, jsonify, current_app, request, Response, json
from flask_login import login_required
from .. import pz_server_state
from ..services.power_actions_service import is_valid_power_action, execute_action
from ..services.server_options_service import ... | 29.8 | 119 | 0.68698 | import glob
import time
from os import path
from flask import Blueprint, jsonify, current_app, request, Response, json
from flask_login import login_required
from .. import pz_server_state
from ..services.power_actions_service import is_valid_power_action, execute_action
from ..services.server_options_service import ... | true | true |
790324f66d285f888aac7461cc4ad401e26f05c1 | 1,939 | py | Python | setup.py | fserena/kg-search | 1f71ff6b90534720bf041a8a87b32b964d5471da | [
"Apache-2.0"
] | 1 | 2022-03-19T07:04:28.000Z | 2022-03-19T07:04:28.000Z | setup.py | fserena/kg-search | 1f71ff6b90534720bf041a8a87b32b964d5471da | [
"Apache-2.0"
] | null | null | null | setup.py | fserena/kg-search | 1f71ff6b90534720bf041a8a87b32b964d5471da | [
"Apache-2.0"
] | null | null | null | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Ontology Engineering Group
http://www.oeg-upm.net/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
Copyright (C) 2016 Ontology Engineering Group.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-... | 39.571429 | 108 | 0.581743 |
import json
from setuptools import setup, find_packages
__author__ = 'Fernando Serena'
with open("kg_search/metadata.json", 'r') as stream:
metadata = json.load(stream)
setup(
name="kg-search",
version=metadata['version'],
author=metadata['author'],
author_email=metadata['email'],
descripti... | true | true |
7903279d69766bd89a827f59c2ccea42083baa16 | 5,727 | py | Python | tools/license_header.py | zhoujqhappy/mxnet-1.3.0-dist-nccl | efd4f887c576e5deec3177e69fd1d928bbc999b0 | [
"Apache-2.0"
] | 399 | 2017-05-30T05:12:48.000Z | 2022-01-29T05:53:08.000Z | tools/license_header.py | zhoujqhappy/mxnet-1.3.0-dist-nccl | efd4f887c576e5deec3177e69fd1d928bbc999b0 | [
"Apache-2.0"
] | 58 | 2017-05-30T23:25:32.000Z | 2019-11-18T09:30:54.000Z | tools/license_header.py | zhoujqhappy/mxnet-1.3.0-dist-nccl | efd4f887c576e5deec3177e69fd1d928bbc999b0 | [
"Apache-2.0"
] | 107 | 2017-05-30T05:53:22.000Z | 2021-06-24T02:43:31.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.134969 | 90 | 0.624411 |
import re
import os
import argparse
_LICENSE = """Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the ... | true | true |
7903286da4685a99816f9e4c3cd9c781984ed661 | 2,376 | py | Python | demos/python/tutorial/tutorial_modules/tutorial_2_send_ble_commands/ble_command_load_group.py | JKlingPhotos/OpenGoPro | 6f01e0d2212e840af3650cbdbf8a648467eed89a | [
"MIT"
] | null | null | null | demos/python/tutorial/tutorial_modules/tutorial_2_send_ble_commands/ble_command_load_group.py | JKlingPhotos/OpenGoPro | 6f01e0d2212e840af3650cbdbf8a648467eed89a | [
"MIT"
] | 1 | 2022-02-03T09:00:45.000Z | 2022-02-04T09:28:34.000Z | demos/python/tutorial/tutorial_modules/tutorial_2_send_ble_commands/ble_command_load_group.py | JKlingPhotos/OpenGoPro | 6f01e0d2212e840af3650cbdbf8a648467eed89a | [
"MIT"
] | null | null | null | # ble_command_load_group.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:57 PM
import sys
import asyncio
import logging
import argparse
from typing import Optional
from binascii import hexlify
from bleak import Blea... | 33 | 165 | 0.694444 |
import sys
import asyncio
import logging
import argparse
from typing import Optional
from binascii import hexlify
from bleak import BleakClient
from tutorial_modules import GOPRO_BASE_UUID, connect_ble
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
async def main(identifier: Optional[str])... | true | true |
790328d2d53e6cdc77e4c7f4348a684c609ecd09 | 20,950 | py | Python | tests/hosting/test_server.py | DaeunYim/pgtoolsservice | b7e548718d797883027b2caee2d4722810b33c0f | [
"MIT"
] | 33 | 2019-05-27T13:04:35.000Z | 2022-03-17T13:33:05.000Z | tests/hosting/test_server.py | DaeunYim/pgtoolsservice | b7e548718d797883027b2caee2d4722810b33c0f | [
"MIT"
] | 31 | 2019-06-10T01:55:47.000Z | 2022-03-09T07:27:49.000Z | tests/hosting/test_server.py | DaeunYim/pgtoolsservice | b7e548718d797883027b2caee2d4722810b33c0f | [
"MIT"
] | 25 | 2019-05-13T18:39:24.000Z | 2021-11-16T03:07:33.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.403162 | 104 | 0.664916 |
import io
from queue import Queue
import time
import unittest
import unittest.mock as mock
from ossdbtoolsservice.hosting.json_rpc_server import (
JSONRPCServer,
IncomingMessageConfiguration,
NotificationContext, RequestContext
)
from ossdbtoolsservice.hosting.json_message import JSONRPCMessage, JSONR... | true | true |
790328e46c96c024cf64b5cf09694459179e5a14 | 1,696 | py | Python | sa/profiles/DCN/DCWS/get_version.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | sa/profiles/DCN/DCWS/get_version.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | sa/profiles/DCN/DCWS/get_version.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Vendor: DCN
# OS: DCWS
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Pyth... | 37.688889 | 90 | 0.533019 |
import re
from noc.core.script.base import BaseScript
from noc.sa.interfaces.igetversion import IGetVersion
class Script(BaseScript):
name = "DCN.DCWS.get_version"
cache = True
interface = IGetVersion
rx_platform = re.compile(r"\s*(?P<platform>\S+)\s+Device.", re.MULTILINE)
rx_ver = re... | true | true |
79032ad483b099f9c6ebdd662967e19e2229d7fb | 9,122 | py | Python | sdks/python/apache_beam/testing/benchmarks/nexmark/nexmark_launcher.py | shitanshu-google/beam | 9cd959f61d377874ee1839c2de4bb8f65a948ecc | [
"Apache-2.0"
] | 3 | 2020-08-28T17:47:26.000Z | 2021-08-17T06:38:58.000Z | sdks/python/apache_beam/testing/benchmarks/nexmark/nexmark_launcher.py | shitanshu-google/beam | 9cd959f61d377874ee1839c2de4bb8f65a948ecc | [
"Apache-2.0"
] | 5 | 2020-11-13T19:06:10.000Z | 2021-11-10T19:56:12.000Z | sdks/python/apache_beam/testing/benchmarks/nexmark/nexmark_launcher.py | shitanshu-google/beam | 9cd959f61d377874ee1839c2de4bb8f65a948ecc | [
"Apache-2.0"
] | 1 | 2021-10-05T20:53:52.000Z | 2021-10-05T20:53:52.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 34.164794 | 125 | 0.691515 |
from __future__ import absolute_import
from __future__ import print_function
import argparse
import logging
import sys
import uuid
from google.cloud import pubsub
import apache_beam as beam
from apache_beam.options.pipeline_options import GoogleCloudOptions
from apache_beam.options.pipeline_optio... | true | true |
79032cdf6c2c38fdab80a0f0def42921f387d137 | 14,378 | py | Python | release/stubs.min/Autodesk/Revit/DB/Structure/__init___parts/FabricSheetType.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/Autodesk/Revit/DB/Structure/__init___parts/FabricSheetType.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/Autodesk/Revit/DB/Structure/__init___parts/FabricSheetType.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class FabricSheetType(ElementType,IDisposable):
""" Represents a fabric sheet type,used in the generation of fabric wires. """
@staticmethod
def CreateDefaultFabricSheetType(ADoc):
"""
CreateDefaultFabricSheetType(ADoc: Document) -> ElementId
Creates a new FabricSheetType object with a default n... | 26.237226 | 246 | 0.728265 | class FabricSheetType(ElementType,IDisposable):
@staticmethod
def CreateDefaultFabricSheetType(ADoc):
pass
def Dispose(self):
pass
def getBoundingBox(self,*args):
pass
def GetReinforcementRoundingManager(self):
pass
def GetWireItem(self,wireIndex,direction):
pass
def IsCustom(self):
pass... | true | true |
79032df596fc0850146cc2b93ec8d69e99711771 | 9,721 | py | Python | flywheel_bids/curate_bids.py | AndysWorth/bids-client | 6c613581e63662d79189a9ead677189cc978c4d0 | [
"MIT"
] | null | null | null | flywheel_bids/curate_bids.py | AndysWorth/bids-client | 6c613581e63662d79189a9ead677189cc978c4d0 | [
"MIT"
] | null | null | null | flywheel_bids/curate_bids.py | AndysWorth/bids-client | 6c613581e63662d79189a9ead677189cc978c4d0 | [
"MIT"
] | null | null | null | import argparse
import logging
import json
import os
import tempfile
import sys
import re
import flywheel
from .supporting_files import bidsify_flywheel, utils, templates
from .supporting_files.project_tree import get_project_tree
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('curate-bids')
def... | 36.82197 | 136 | 0.640778 | import argparse
import logging
import json
import os
import tempfile
import sys
import re
import flywheel
from .supporting_files import bidsify_flywheel, utils, templates
from .supporting_files.project_tree import get_project_tree
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('curate-bids')
def... | true | true |
79032ebd5c06411c65fe7b6b75516feadbaf0fde | 7,939 | py | Python | exp/inference/inference_dir.py | ericwang0701/Graphonomy | 1942bd41723ec48e5133f932082a49d1c17050ad | [
"MIT"
] | null | null | null | exp/inference/inference_dir.py | ericwang0701/Graphonomy | 1942bd41723ec48e5133f932082a49d1c17050ad | [
"MIT"
] | null | null | null | exp/inference/inference_dir.py | ericwang0701/Graphonomy | 1942bd41723ec48e5133f932082a49d1c17050ad | [
"MIT"
] | null | null | null | import socket
import timeit
import numpy as np
from PIL import Image
from datetime import datetime
import os
import sys
from collections import OrderedDict
sys.path.append('./')
# PyTorch includes
import torch
from torch.autograd import Variable
from torchvision import transforms
import cv2
# Custom includes
from net... | 36.417431 | 181 | 0.623504 | import socket
import timeit
import numpy as np
from PIL import Image
from datetime import datetime
import os
import sys
from collections import OrderedDict
sys.path.append('./')
import torch
from torch.autograd import Variable
from torchvision import transforms
import cv2
from networks import deeplab_xception_trans... | true | true |
79032f18745a632a75505068cc5317f7be76e766 | 4,662 | py | Python | app/main.py | ntmk/battlesnake-2019-pixelated | cd589c51c892943a37c1c594848524fb6667bf87 | [
"MIT"
] | 1 | 2019-11-20T18:17:23.000Z | 2019-11-20T18:17:23.000Z | app/main.py | ntmk/battlesnake-pixelated-2019 | cd589c51c892943a37c1c594848524fb6667bf87 | [
"MIT"
] | 1 | 2019-03-08T23:16:23.000Z | 2019-07-13T15:32:39.000Z | app/main.py | ntmk/battlesnake-pixelated-2019 | cd589c51c892943a37c1c594848524fb6667bf87 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import bottle
import os, json
from .utils import distance, neighbours, direction
from .defensive import find_my_tail, trouble, find_enemy_tail, eat_food, find_my_tail_emergency
from .snake import Snake
from .gameboard import GameBoard
SAFTEY = 0
SNAKE = 1
FOOD = 3
DANGER = 5
def move_response(... | 29.506329 | 103 | 0.586015 |
import bottle
import os, json
from .utils import distance, neighbours, direction
from .defensive import find_my_tail, trouble, find_enemy_tail, eat_food, find_my_tail_emergency
from .snake import Snake
from .gameboard import GameBoard
SAFTEY = 0
SNAKE = 1
FOOD = 3
DANGER = 5
def move_response(move):
assert mov... | true | true |
7903304b2bafccb55d17a46f82882ca7708ef2ae | 107 | py | Python | lab_assignment/lab_bla/linux_mac/sample/matrix_transpose.py | caru1613/introduction_to_python_TEAMLAB_MOOC | e0ac95f7a6b889e7d18b7bdaaab49820e73d5477 | [
"MIT"
] | null | null | null | lab_assignment/lab_bla/linux_mac/sample/matrix_transpose.py | caru1613/introduction_to_python_TEAMLAB_MOOC | e0ac95f7a6b889e7d18b7bdaaab49820e73d5477 | [
"MIT"
] | null | null | null | lab_assignment/lab_bla/linux_mac/sample/matrix_transpose.py | caru1613/introduction_to_python_TEAMLAB_MOOC | e0ac95f7a6b889e7d18b7bdaaab49820e73d5477 | [
"MIT"
] | null | null | null | matrix_a = [[1,2,3], [4,5,6]]
result = [ [ element for element in t] for t in zip(*matrix_a)]
print(result) | 35.666667 | 63 | 0.635514 | matrix_a = [[1,2,3], [4,5,6]]
result = [ [ element for element in t] for t in zip(*matrix_a)]
print(result) | true | true |
79033105a332cf5f0ab126fa06b0320675587b9b | 11,198 | py | Python | google/ads/googleads/v4/services/services/ad_group_service/transports/grpc.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/services/services/ad_group_service/transports/grpc.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/services/services/ad_group_service/transports/grpc.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 41.169118 | 90 | 0.621361 |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
from google import auth
from google.auth import credentials
from google.auth.transport.grpc import SslCredentials
import grpc
from go... | true | true |
790331921901efd91310267d0e6875aef4916335 | 1,990 | py | Python | score_system.py | charlieconneely/countdown | e941d8e89091a5bfcc5af77d5e0742725ce4b7fd | [
"MIT"
] | 1 | 2020-06-17T21:00:18.000Z | 2020-06-17T21:00:18.000Z | score_system.py | charlieconneely/countdown | e941d8e89091a5bfcc5af77d5e0742725ce4b7fd | [
"MIT"
] | null | null | null | score_system.py | charlieconneely/countdown | e941d8e89091a5bfcc5af77d5e0742725ce4b7fd | [
"MIT"
] | 2 | 2020-06-09T18:31:55.000Z | 2020-06-09T18:33:29.000Z | # Charlie Conneely
# Score Keeper
from player import Player
ranks_file = "rankings.txt"
class ScoreKeeper:
def __init__(self):
self.ranks = []
"""
Check if player score ranks against scores in rankings.txt
"""
def check_ranking(self, p):
self.populate_ranks_array(ranks_file)
... | 28.428571 | 80 | 0.548241 |
from player import Player
ranks_file = "rankings.txt"
class ScoreKeeper:
def __init__(self):
self.ranks = []
def check_ranking(self, p):
self.populate_ranks_array(ranks_file)
top5 = self.compare_score(p)
if top5:
print("Well Done! You ranked Top 5!")
... | true | true |
790332e6267a04177d813875e9e0670bc4500d5e | 1,487 | py | Python | python/etc/preprocessing/norway/norway_preprocessing.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 89 | 2015-02-13T13:46:06.000Z | 2022-03-13T16:42:44.000Z | python/etc/preprocessing/norway/norway_preprocessing.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 91 | 2015-03-12T13:31:36.000Z | 2022-01-14T07:37:37.000Z | python/etc/preprocessing/norway/norway_preprocessing.py | sma-h/openapc-de | 0ec2d42d525219d801f71538f5b30ca6fecd9d3a | [
"Cube"
] | 138 | 2015-03-04T15:23:43.000Z | 2022-03-09T15:11:52.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import argparse
from os import path
import sys
AVG_YEARLY_CONVERSION_RATES = {
"2015": 0.1119,
"2016": 0.1077
}
def main():
parser = argparse.ArgumentParser()
parser.add_argument("source_file")
args = parser.parse_args()
result = oat.analyze_csv_file... | 29.156863 | 99 | 0.656355 |
import argparse
from os import path
import sys
AVG_YEARLY_CONVERSION_RATES = {
"2015": 0.1119,
"2016": 0.1077
}
def main():
parser = argparse.ArgumentParser()
parser.add_argument("source_file")
args = parser.parse_args()
result = oat.analyze_csv_file(args.source_file, 500)
if result["s... | false | true |
7903335abe3e4f390662c49d8c6f2320d97652a9 | 393 | py | Python | 1. Algorithmic Toolbox/week5_dynamic_programming1/1_money_change_again.py | vishweshwartyagi/Data-Structures-and-Algorithms-UCSD | de942b3a0eb2bf56f949f47c297fad713aa81489 | [
"MIT"
] | null | null | null | 1. Algorithmic Toolbox/week5_dynamic_programming1/1_money_change_again.py | vishweshwartyagi/Data-Structures-and-Algorithms-UCSD | de942b3a0eb2bf56f949f47c297fad713aa81489 | [
"MIT"
] | null | null | null | 1. Algorithmic Toolbox/week5_dynamic_programming1/1_money_change_again.py | vishweshwartyagi/Data-Structures-and-Algorithms-UCSD | de942b3a0eb2bf56f949f47c297fad713aa81489 | [
"MIT"
] | null | null | null | # Uses python3
import sys
def get_change(money, coins):
t = [j+1 for j in range(money+1)]
# boundary condition
t[0] = 0
for j in range(1, money+1):
for c in coins:
if c <= j:
t[j] = min(t[j], 1+t[j-c])
return t[money]
if __name__ == '__main__':
coins =... | 18.714286 | 42 | 0.516539 |
import sys
def get_change(money, coins):
t = [j+1 for j in range(money+1)]
t[0] = 0
for j in range(1, money+1):
for c in coins:
if c <= j:
t[j] = min(t[j], 1+t[j-c])
return t[money]
if __name__ == '__main__':
coins = [1, 3, 4]
money = int(input()... | true | true |
79033470995dc52bd40a847629f57fcf0205e8fd | 10,160 | py | Python | torch/utils/data/sampler.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 5 | 2021-08-17T17:44:20.000Z | 2021-08-21T05:03:42.000Z | torch/utils/data/sampler.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 1 | 2021-04-22T18:37:42.000Z | 2021-04-28T00:53:25.000Z | torch/utils/data/sampler.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 1 | 2022-01-19T10:55:49.000Z | 2022-01-19T10:55:49.000Z | import torch
from torch import Tensor
from typing import Iterator, Optional, Sequence, List, TypeVar, Generic, Sized
T_co = TypeVar('T_co', covariant=True)
class Sampler(Generic[T_co]):
r"""Base class for all Samplers.
Every Sampler subclass has to provide an :meth:`__iter__` method, providing a
way to ... | 41.983471 | 129 | 0.638189 | import torch
from torch import Tensor
from typing import Iterator, Optional, Sequence, List, TypeVar, Generic, Sized
T_co = TypeVar('T_co', covariant=True)
class Sampler(Generic[T_co]):
def __init__(self, data_source: Optional[Sized]) -> None:
pass
def __iter__(self) -> Iterator[T_co]:
rais... | true | true |
790334aaa6224426d91a6b965c9ea7f4e423a405 | 4,352 | py | Python | _unittests/ut_talk_examples/test_pydata2016_animation.py | sdpython/jupytalk | 34abdf128de24becb21a9f08f243c3a74dadbfd9 | [
"MIT"
] | null | null | null | _unittests/ut_talk_examples/test_pydata2016_animation.py | sdpython/jupytalk | 34abdf128de24becb21a9f08f243c3a74dadbfd9 | [
"MIT"
] | 16 | 2016-11-13T19:52:35.000Z | 2021-12-29T10:59:41.000Z | _unittests/ut_talk_examples/test_pydata2016_animation.py | sdpython/jupytalk | 34abdf128de24becb21a9f08f243c3a74dadbfd9 | [
"MIT"
] | 4 | 2016-09-10T10:44:50.000Z | 2021-09-22T16:28:56.000Z | """
@brief test log(time=20s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG, run_cmd
from pyquickhelper.pycode import get_temp_folder, fix_tkinter_issues_virtualenv, skipif_appveyor, skipif_travis
from pyquickhelper.pycode import add_missing_development_version
class TestPyDa... | 34.816 | 111 | 0.535156 |
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG, run_cmd
from pyquickhelper.pycode import get_temp_folder, fix_tkinter_issues_virtualenv, skipif_appveyor, skipif_travis
from pyquickhelper.pycode import add_missing_development_version
class TestPyData2016Animation(unittest.TestCase):
... | true | true |
7903355e192c505c3666b728bed050fc189a8e2b | 1,763 | py | Python | pybgl/prune_incidence_automaton.py | nokia/PyBGL | e9868361e5a3870b5247872a8c8c91a1c065fe84 | [
"BSD-3-Clause"
] | 11 | 2019-05-20T16:47:03.000Z | 2021-12-17T10:24:22.000Z | pybgl/prune_incidence_automaton.py | nokia/PyBGL | e9868361e5a3870b5247872a8c8c91a1c065fe84 | [
"BSD-3-Clause"
] | null | null | null | pybgl/prune_incidence_automaton.py | nokia/PyBGL | e9868361e5a3870b5247872a8c8c91a1c065fe84 | [
"BSD-3-Clause"
] | 3 | 2019-05-24T02:24:30.000Z | 2020-03-17T09:55:40.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Marc-Olivier Buob, Maxime Raynal"
__maintainer__ = "Marc-Olivier Buob, Maxime Raynal"
__email__ = "{marc-olivier.buob,maxime.raynal}@nokia.com"
__copyright__ = "Copyright (C) 2020, Nokia"
__license__ = "BSD-3"
from collections imp... | 35.979592 | 72 | 0.708452 |
__author__ = "Marc-Olivier Buob, Maxime Raynal"
__maintainer__ = "Marc-Olivier Buob, Maxime Raynal"
__email__ = "{marc-olivier.buob,maxime.raynal}@nokia.com"
__copyright__ = "Copyright (C) 2020, Nokia"
__license__ = "BSD-3"
from collections import defaultdict
from pybgl.graph ... | true | true |
7903356d94d14d81e2b9f370eafe7346ce241eca | 9,677 | py | Python | sdk/python/pulumi_aws/apigateway/usage_plan.py | JakeGinnivan/pulumi-aws | c91ef78932964ac74eda7f5da81f65b0f1798c93 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/apigateway/usage_plan.py | JakeGinnivan/pulumi-aws | c91ef78932964ac74eda7f5da81f65b0f1798c93 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/apigateway/usage_plan.py | JakeGinnivan/pulumi-aws | c91ef78932964ac74eda7f5da81f65b0f1798c93 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class UsageP... | 46.524038 | 225 | 0.644105 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class UsagePlan(pulumi.CustomResource):
api_stages: pulumi.Output[list]
arn: pulumi.Output[str]
description: pulumi.Output[str]
name: pulumi.Output[str]
product_code: pulumi... | true | true |
790335f67e5e6d53312a71ca4736eeb2dd481cc6 | 2,663 | py | Python | examples/python/quickstart_sql.py | backwardn/delta | 011c122f00f8e8772de57e06b7b3e8137e1f3701 | [
"Apache-2.0"
] | 1 | 2021-01-26T21:37:11.000Z | 2021-01-26T21:37:11.000Z | examples/python/quickstart_sql.py | jaceklaskowski/delta | 87fecf37b68d44cf99a18cafc16a7092bb2a723a | [
"Apache-2.0"
] | null | null | null | examples/python/quickstart_sql.py | jaceklaskowski/delta | 87fecf37b68d44cf99a18cafc16a7092bb2a723a | [
"Apache-2.0"
] | null | null | null |
from pyspark.sql import Column, DataFrame, SparkSession, functions
from pyspark.sql.functions import *
from py4j.java_collections import MapConverter
from delta.tables import *
import shutil
import threading
tableName = "tbltestpython"
# Enable SQL/DML commands and Metastore tables for the current spark session.
# W... | 35.986486 | 99 | 0.615096 |
from pyspark.sql import Column, DataFrame, SparkSession, functions
from pyspark.sql.functions import *
from py4j.java_collections import MapConverter
from delta.tables import *
import shutil
import threading
tableName = "tbltestpython"
spark = SparkSession.builder \
.appName("quickstart_sql") \
.master("l... | true | true |
790336255dd1898a90d62aebd5cb50c087f6beb1 | 1,930 | py | Python | app/modules/serverinfo/models.py | sappykun/scpsl-masterserver | 1ce03f7b6f8e53dd44364121eca34cc7b1fdeddd | [
"MIT"
] | null | null | null | app/modules/serverinfo/models.py | sappykun/scpsl-masterserver | 1ce03f7b6f8e53dd44364121eca34cc7b1fdeddd | [
"MIT"
] | null | null | null | app/modules/serverinfo/models.py | sappykun/scpsl-masterserver | 1ce03f7b6f8e53dd44364121eca34cc7b1fdeddd | [
"MIT"
] | null | null | null | import time, datetime
from app import db
class ServerInfo(db.Model):
__tablename__ = 'servers'
__table_args__ = (db.PrimaryKeyConstraint('ip', 'port', name='_ip_port_pk'),)
ip = db.Column(db.String(128), nullable=False)
port = db.Column(db.Integer, nullable=False)
... | 35.090909 | 82 | 0.58601 | import time, datetime
from app import db
class ServerInfo(db.Model):
__tablename__ = 'servers'
__table_args__ = (db.PrimaryKeyConstraint('ip', 'port', name='_ip_port_pk'),)
ip = db.Column(db.String(128), nullable=False)
port = db.Column(db.Integer, nullable=False)
... | true | true |
7903367b9aa6bfbb5d9da2c38eb07d55a385c654 | 2,740 | py | Python | vgg/test.py | mhd53/vgg-from-torch | fbcca53432648a492550fb14d2c42c10230d76f5 | [
"MIT"
] | null | null | null | vgg/test.py | mhd53/vgg-from-torch | fbcca53432648a492550fb14d2c42c10230d76f5 | [
"MIT"
] | null | null | null | vgg/test.py | mhd53/vgg-from-torch | fbcca53432648a492550fb14d2c42c10230d76f5 | [
"MIT"
] | null | null | null | import argparse
import torch
from tqdm import tqdm
import vgg.data_loader.data_loaders as module_data
import vgg.model.loss as module_loss
import vgg.model.metric as module_metric
import vgg.model.model as module_arch
from vgg.parse_config import ConfigParser
def main(config):
logger = config.get_logger('test')
... | 33.414634 | 93 | 0.641241 | import argparse
import torch
from tqdm import tqdm
import vgg.data_loader.data_loaders as module_data
import vgg.model.loss as module_loss
import vgg.model.metric as module_metric
import vgg.model.model as module_arch
from vgg.parse_config import ConfigParser
def main(config):
logger = config.get_logger('test')
... | true | true |
790337381459139a145ec5c72b9aba4345e71b90 | 3,297 | py | Python | tockloader/tab.py | torfmaster/tockloader | f833879dfb870d45c5ac0970f4cb4f8e8c515c48 | [
"MIT"
] | null | null | null | tockloader/tab.py | torfmaster/tockloader | f833879dfb870d45c5ac0970f4cb4f8e8c515c48 | [
"MIT"
] | null | null | null | tockloader/tab.py | torfmaster/tockloader | f833879dfb870d45c5ac0970f4cb4f8e8c515c48 | [
"MIT"
] | null | null | null | import tarfile
import textwrap
import pytoml
from .app import App
from .exceptions import TockLoaderException
from .tbfh import TBFHeader
class TAB:
'''
Tock Application Bundle object. This class handles the TAB format.
'''
def __init__ (self, tab_path):
self.tab = tarfile.open(tab_path)
def extract_app (sel... | 32.009709 | 107 | 0.693358 | import tarfile
import textwrap
import pytoml
from .app import App
from .exceptions import TockLoaderException
from .tbfh import TBFHeader
class TAB:
def __init__ (self, tab_path):
self.tab = tarfile.open(tab_path)
def extract_app (self, arch):
binary_tarinfo = self.tab.getmember('{}.bin'.format(arch))
binar... | true | true |
79033767bda915e916a7a2507007bdb76a27ba58 | 32,085 | py | Python | omegaconf/basecontainer.py | gwenzek/omegaconf | 0ff8a401739d00b01d88408c262a0f061ff3be68 | [
"BSD-3-Clause"
] | null | null | null | omegaconf/basecontainer.py | gwenzek/omegaconf | 0ff8a401739d00b01d88408c262a0f061ff3be68 | [
"BSD-3-Clause"
] | null | null | null | omegaconf/basecontainer.py | gwenzek/omegaconf | 0ff8a401739d00b01d88408c262a0f061ff3be68 | [
"BSD-3-Clause"
] | null | null | null | import copy
import sys
from abc import ABC, abstractmethod
from enum import Enum
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Tuple, Union
import yaml
from ._utils import (
_DEFAULT_MARKER_,
ValueKind,
_ensure_container,
_get_value,
_is_interpolation,
_is_missing_lite... | 36.87931 | 103 | 0.569331 | import copy
import sys
from abc import ABC, abstractmethod
from enum import Enum
from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Tuple, Union
import yaml
from ._utils import (
_DEFAULT_MARKER_,
ValueKind,
_ensure_container,
_get_value,
_is_interpolation,
_is_missing_lite... | true | true |
790337b5ebb41712126a25e1814cf7d7972e199d | 4,665 | py | Python | tools/run_clang_format.py | markcutler/autopilot | bc55a52651f711843e8c234114e7b9f065c01bc9 | [
"MIT"
] | null | null | null | tools/run_clang_format.py | markcutler/autopilot | bc55a52651f711843e8c234114e7b9f065c01bc9 | [
"MIT"
] | null | null | null | tools/run_clang_format.py | markcutler/autopilot | bc55a52651f711843e8c234114e7b9f065c01bc9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import click
import os
import tempfile
import filecmp
import shutil
import difflib
import sys
import git
import shell_utils
SOURCE_EXTENSIONS = [".cpp", ".c", ".cxx", ".cc", ".h", ".hxx", ".hpp"]
class Colors:
HEADER = '\033[95m'
BLUE = '\033[94m'
CYAN = '\033[96m'
GREEN = '\033... | 37.02381 | 120 | 0.629582 |
import click
import os
import tempfile
import filecmp
import shutil
import difflib
import sys
import git
import shell_utils
SOURCE_EXTENSIONS = [".cpp", ".c", ".cxx", ".cc", ".h", ".hxx", ".hpp"]
class Colors:
HEADER = '\033[95m'
BLUE = '\033[94m'
CYAN = '\033[96m'
GREEN = '\033[92m'
YELLOW =... | true | true |
79033800a202c366932dad5c58be20ae82d974e5 | 1,452 | py | Python | tests/core/test_traverse.py | next-franciscoalgaba/python-benedict | 81ff459304868327238c322a0a8a203d9d5d4314 | [
"MIT"
] | 365 | 2019-05-21T05:50:30.000Z | 2022-03-29T11:35:35.000Z | tests/core/test_traverse.py | next-franciscoalgaba/python-benedict | 81ff459304868327238c322a0a8a203d9d5d4314 | [
"MIT"
] | 78 | 2019-11-16T12:22:54.000Z | 2022-03-14T12:21:30.000Z | tests/core/test_traverse.py | next-franciscoalgaba/python-benedict | 81ff459304868327238c322a0a8a203d9d5d4314 | [
"MIT"
] | 26 | 2019-12-16T06:34:12.000Z | 2022-02-28T07:16:41.000Z | # -*- coding: utf-8 -*-
from benedict.core import clone as _clone
from benedict.core import traverse as _traverse
import unittest
class traverse_test_case(unittest.TestCase):
def test_traverse(self):
i = {
'a': {
'x': 2,
'y': 3,
'z': {
... | 22 | 47 | 0.249311 |
from benedict.core import clone as _clone
from benedict.core import traverse as _traverse
import unittest
class traverse_test_case(unittest.TestCase):
def test_traverse(self):
i = {
'a': {
'x': 2,
'y': 3,
'z': {
'ok': 5,
... | true | true |
7903380d28b911cf809d3bab7b3f2462ff4f1120 | 8,099 | py | Python | yandex_market_language/models/shop.py | stefanitsky/yandex_market_language | e17595b556fc55e183cf366227b2739c5c6178dc | [
"MIT"
] | 7 | 2020-03-28T22:35:52.000Z | 2021-09-16T10:50:10.000Z | yandex_market_language/models/shop.py | stefanitsky/yandex_market_language | e17595b556fc55e183cf366227b2739c5c6178dc | [
"MIT"
] | 192 | 2020-03-29T12:38:53.000Z | 2021-09-01T14:12:07.000Z | yandex_market_language/models/shop.py | stefanitsky/yandex_market_language | e17595b556fc55e183cf366227b2739c5c6178dc | [
"MIT"
] | 6 | 2020-06-05T09:07:02.000Z | 2021-11-28T14:37:58.000Z | from typing import List
from yandex_market_language import models, exceptions
from yandex_market_language.models import fields
from yandex_market_language.models.abstract import XMLElement, XMLSubElement
from yandex_market_language.exceptions import ValidationError
class Shop(
fields.EnableAutoDiscountField,
... | 34.172996 | 79 | 0.540684 | from typing import List
from yandex_market_language import models, exceptions
from yandex_market_language.models import fields
from yandex_market_language.models.abstract import XMLElement, XMLSubElement
from yandex_market_language.exceptions import ValidationError
class Shop(
fields.EnableAutoDiscountField,
... | true | true |
7903386c03359f170d66886b95a3ab0227613175 | 1,199 | py | Python | tradefed_cluster/device_blocker.py | maksonlee/tradefed_cluster | d1153743ce8ddcad752443b23851015630862aea | [
"Apache-2.0"
] | null | null | null | tradefed_cluster/device_blocker.py | maksonlee/tradefed_cluster | d1153743ce8ddcad752443b23851015630862aea | [
"Apache-2.0"
] | null | null | null | tradefed_cluster/device_blocker.py | maksonlee/tradefed_cluster | d1153743ce8ddcad752443b23851015630862aea | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.405405 | 74 | 0.764804 |
from __future__ import absolute_import
from __future__ import division
from __future__ import google_type_annotations
from __future__ import print_function
from tradefed_cluster import datastore_entities
def IsLabBlocked(lab_name):
device_blocklists = (
datastore_entities.DeviceBlocklist.query(... | true | true |
79033900592f01fd75e20a66b3237b2e60d03fb3 | 1,953 | py | Python | backend/accounts/views.py | eliefrancois/project2-diabetesapplication-api | e0fd904b1f50eb7ed68fe1ceb74c2a1784e8dc40 | [
"MIT"
] | null | null | null | backend/accounts/views.py | eliefrancois/project2-diabetesapplication-api | e0fd904b1f50eb7ed68fe1ceb74c2a1784e8dc40 | [
"MIT"
] | null | null | null | backend/accounts/views.py | eliefrancois/project2-diabetesapplication-api | e0fd904b1f50eb7ed68fe1ceb74c2a1784e8dc40 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from accounts import models
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_set... | 54.25 | 153 | 0.777266 | from django.shortcuts import render
from accounts import models
from rest_framework import viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_set... | true | true |
7903399be9ce2f08abf032e744e8f8058081f1b6 | 2,273 | py | Python | deepinsight_iqa/nima/predict.py | sandyz1000/deepinsight-iqa | 1be15ba4bdb005d05d01eddd247de1dafbf3d256 | [
"Apache-2.0"
] | 2 | 2021-11-22T15:57:47.000Z | 2021-11-23T12:02:56.000Z | deepinsight_iqa/nima/predict.py | sandyz1000/deepinsight-iqa | 1be15ba4bdb005d05d01eddd247de1dafbf3d256 | [
"Apache-2.0"
] | null | null | null | deepinsight_iqa/nima/predict.py | sandyz1000/deepinsight-iqa | 1be15ba4bdb005d05d01eddd247de1dafbf3d256 | [
"Apache-2.0"
] | 1 | 2022-02-05T03:19:31.000Z | 2022-02-05T03:19:31.000Z | import os
import glob
import sys
from typing import Optional, List, Union
from .utils.utils import calc_mean_score, save_json, image_dir_to_json, image_file_to_json
from .handlers.model_builder import Nima
from deepinsight_iqa.common.utility import thread_safe_singleton, set_gpu_limit
from deepinsight_iqa.data_pipeline... | 32.942029 | 102 | 0.66564 | import os
import glob
import sys
from typing import Optional, List, Union
from .utils.utils import calc_mean_score, save_json, image_dir_to_json, image_file_to_json
from .handlers.model_builder import Nima
from deepinsight_iqa.common.utility import thread_safe_singleton, set_gpu_limit
from deepinsight_iqa.data_pipeline... | true | true |
79033b5c42283a7d3287e201bd372d9dca5ef6a8 | 1,074 | py | Python | services/web/server/src/simcore_service_webserver/director/config.py | KZzizzle/osparc-simcore | 981bc8d193f3f5d507e3225f857e0308c339e163 | [
"MIT"
] | null | null | null | services/web/server/src/simcore_service_webserver/director/config.py | KZzizzle/osparc-simcore | 981bc8d193f3f5d507e3225f857e0308c339e163 | [
"MIT"
] | null | null | null | services/web/server/src/simcore_service_webserver/director/config.py | KZzizzle/osparc-simcore | 981bc8d193f3f5d507e3225f857e0308c339e163 | [
"MIT"
] | null | null | null | """ director subsystem's configuration
- config-file schema
- settings
"""
from typing import Dict
import trafaret as T
from aiohttp import ClientSession, web
from yarl import URL
from servicelib.application_keys import APP_CLIENT_SESSION_KEY, APP_CONFIG_KEY
APP_DIRECTOR_API_KEY = __name__ + ".director_api"... | 24.976744 | 78 | 0.679702 | from typing import Dict
import trafaret as T
from aiohttp import ClientSession, web
from yarl import URL
from servicelib.application_keys import APP_CLIENT_SESSION_KEY, APP_CONFIG_KEY
APP_DIRECTOR_API_KEY = __name__ + ".director_api"
CONFIG_SECTION_NAME = "director"
schema = T.Dict(
{
T.Key("enabled", ... | true | true |
79033c3abb5425c24997413b7192536ca58adde2 | 1,181 | py | Python | ctrp3_py3/reports/urls.py | CT-Data-Collaborative/ctrp3_v2 | 5224e4ad5e3a4497379030d7974a11c5c4832d19 | [
"MIT"
] | null | null | null | ctrp3_py3/reports/urls.py | CT-Data-Collaborative/ctrp3_v2 | 5224e4ad5e3a4497379030d7974a11c5c4832d19 | [
"MIT"
] | 1 | 2017-09-15T21:01:40.000Z | 2017-09-15T21:01:40.000Z | ctrp3_py3/reports/urls.py | CT-Data-Collaborative/ctrp3_v2 | 5224e4ad5e3a4497379030d7974a11c5c4832d19 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'tables/$', views.report_tables, name='tables'),
url(r'^api/stop_enforcement/', views.stop_enforcement_json_view, name='stop_enforcement'),
url(r'^api/residency/', views.resident_json_view, name='residency'),
url(r'^api/nature_of... | 62.157895 | 100 | 0.751058 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'tables/$', views.report_tables, name='tables'),
url(r'^api/stop_enforcement/', views.stop_enforcement_json_view, name='stop_enforcement'),
url(r'^api/residency/', views.resident_json_view, name='residency'),
url(r'^api/nature_of... | true | true |
79033c774b2b31136b9910c82aadafd4f39f3d90 | 1,134 | py | Python | solutions/quick_sort.py | Surbeivol/daily-coding-problems | 4cfd47af47d2d41d348e542154120749e711b1c8 | [
"MIT"
] | 1 | 2019-08-12T21:40:49.000Z | 2019-08-12T21:40:49.000Z | solutions/quick_sort.py | Surbeivol/daily-coding-problems | 4cfd47af47d2d41d348e542154120749e711b1c8 | [
"MIT"
] | null | null | null | solutions/quick_sort.py | Surbeivol/daily-coding-problems | 4cfd47af47d2d41d348e542154120749e711b1c8 | [
"MIT"
] | 1 | 2020-02-19T20:59:23.000Z | 2020-02-19T20:59:23.000Z | """
Write a function that takes in an array of integers and returns a sorted version of that array. Use the QuickSort algorithm to sort the array.
"""
def quick_sort(array):
if len(array) <= 1:
return array
_rec_helper(array, 0, len(array) - 1)
return array
def _rec_helper(array, start, end):
... | 25.772727 | 142 | 0.589947 |
def quick_sort(array):
if len(array) <= 1:
return array
_rec_helper(array, 0, len(array) - 1)
return array
def _rec_helper(array, start, end):
if start >= end:
return
pivot = start
left = pivot + 1
right = end
while left <= right:
if array[left] > array[... | true | true |
79033d08d95c45a42f88d1e3a2fafc24e9f25b1e | 2,370 | py | Python | src/ggrc/utils/html_cleaner.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/utils/html_cleaner.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/utils/html_cleaner.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-02-13T12:32:45.000Z | 2020-02-13T12:32:45.000Z | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Provides an HTML cleaner function with sqalchemy compatible API"""
import re
import HTMLParser
import bleach
# Set up custom tags/attributes for bleach
BLEACH_TAGS = [
'caption', 'strong', 'em', '... | 27.55814 | 78 | 0.646835 |
import re
import HTMLParser
import bleach
BLEACH_TAGS = [
'caption', 'strong', 'em', 'b', 'i', 'p', 'code', 'pre', 'tt', 'samp',
'kbd', 'var', 'sub', 'sup', 'dfn', 'cite', 'big', 'small', 'address',
'hr', 'br', 'div', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul',
'ol', 'li', 'dl', 'dt', 'dd'... | true | true |
79033d48e47032f01280a94dfd26c731e5df4113 | 1,827 | py | Python | samples/generated_samples/aiplatform_v1_generated_specialist_pool_service_create_specialist_pool_async.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | samples/generated_samples/aiplatform_v1_generated_specialist_pool_service_create_specialist_pool_async.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/aiplatform_v1_generated_specialist_pool_service_create_specialist_pool_async.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.218182 | 85 | 0.767378 |
from google.cloud import aiplatform_v1
async def sample_create_specialist_pool():
client = aiplatform_v1.SpecialistPoolServiceAsyncClient()
specialist_pool = aiplatform_v1.SpecialistPool()
specialist_pool.name = "name_value"
specialist_pool.display_name = "display_... | true | true |
79033e329aeeed6995605fb7fa079108c03ba683 | 8,699 | py | Python | awx/main/dispatch/worker/callback.py | Mayses/awx | 35441694a9707d0d2f57c701970db22110091163 | [
"Apache-2.0"
] | 1 | 2021-08-02T10:37:09.000Z | 2021-08-02T10:37:09.000Z | awx/main/dispatch/worker/callback.py | Mayses/awx | 35441694a9707d0d2f57c701970db22110091163 | [
"Apache-2.0"
] | 2 | 2019-03-01T19:08:10.000Z | 2020-03-12T09:14:27.000Z | awx/main/dispatch/worker/callback.py | hostinger/awx | dac01b14e2c04c201a162ea03ef8386d822e3923 | [
"Apache-2.0"
] | 24 | 2020-11-27T08:37:35.000Z | 2021-03-08T13:27:15.000Z | import cProfile
import json
import logging
import os
import pstats
import signal
import tempfile
import time
import traceback
from django.conf import settings
from django.utils.timezone import now as tz_now
from django.db import DatabaseError, OperationalError, connection as django_connection
from django.db.utils impo... | 40.840376 | 136 | 0.550178 | import cProfile
import json
import logging
import os
import pstats
import signal
import tempfile
import time
import traceback
from django.conf import settings
from django.utils.timezone import now as tz_now
from django.db import DatabaseError, OperationalError, connection as django_connection
from django.db.utils impo... | true | true |
790341431528bf4d0db5b5dba15949090cd333a0 | 1,442 | py | Python | seafileapi/utils.py | nguacon01/python-seafile | 943592b89b78f79540771be37db639bd1879995e | [
"Apache-2.0"
] | 5 | 2020-12-17T02:13:18.000Z | 2021-07-30T11:42:39.000Z | seafileapi/utils.py | nguacon01/python-seafile | 943592b89b78f79540771be37db639bd1879995e | [
"Apache-2.0"
] | 2 | 2020-12-17T14:34:42.000Z | 2021-01-11T16:22:52.000Z | seafileapi/utils.py | nguacon01/python-seafile | 943592b89b78f79540771be37db639bd1879995e | [
"Apache-2.0"
] | null | null | null | import string
import random
from functools import wraps
from urllib.parse import urlencode
from seafileapi.exceptions import ClientHttpError, DoesNotExist
def randstring(length=0):
if length == 0:
length = random.randint(1, 30)
return ''.join(random.choice(string.lowercase) for i in range(length))
def... | 24.862069 | 74 | 0.575589 | import string
import random
from functools import wraps
from urllib.parse import urlencode
from seafileapi.exceptions import ClientHttpError, DoesNotExist
def randstring(length=0):
if length == 0:
length = random.randint(1, 30)
return ''.join(random.choice(string.lowercase) for i in range(length))
def... | true | true |
790341dae8dd98e984f133b238e81d9bcf4bcb94 | 1,559 | py | Python | share/scripts/augen_octahedron2camera.py | eliemichel/GrainViewer | 91d4922b3185ada90508f0944f2691ba8eba45e3 | [
"MIT"
] | 8 | 2020-12-14T13:14:22.000Z | 2021-12-11T20:04:54.000Z | share/scripts/augen_octahedron2camera.py | eliemichel/GrainViewer | 91d4922b3185ada90508f0944f2691ba8eba45e3 | [
"MIT"
] | null | null | null | share/scripts/augen_octahedron2camera.py | eliemichel/GrainViewer | 91d4922b3185ada90508f0944f2691ba8eba45e3 | [
"MIT"
] | 2 | 2020-12-16T10:02:15.000Z | 2021-03-16T16:06:19.000Z | import sys
import struct
from math import sqrt
def cross(a, b):
return [
a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] * b[0]
]
def dot(a, b):
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
def normalized(a):
s = 1 / sqrt(dot(a, a))
return [ a[0]... | 26.87931 | 84 | 0.502245 | import sys
import struct
from math import sqrt
def cross(a, b):
return [
a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] * b[0]
]
def dot(a, b):
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
def normalized(a):
s = 1 / sqrt(dot(a, a))
return [ a[0]... | true | true |
790342aed0669dd446268dba8cc861cbb980a333 | 3,335 | py | Python | app/__init__.py | natalia-rios/flask-mega-tutorial | 496d44b1123c174e1b2afcd227855d0c6c047572 | [
"MIT"
] | null | null | null | app/__init__.py | natalia-rios/flask-mega-tutorial | 496d44b1123c174e1b2afcd227855d0c6c047572 | [
"MIT"
] | null | null | null | app/__init__.py | natalia-rios/flask-mega-tutorial | 496d44b1123c174e1b2afcd227855d0c6c047572 | [
"MIT"
] | null | null | null | import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
from flask import Flask, request, current_app
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail
from flask_bootstrap import Bootstrap
from flask... | 33.686869 | 79 | 0.664168 | import logging
from logging.handlers import SMTPHandler, RotatingFileHandler
import os
from flask import Flask, request, current_app
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_mail import Mail
from flask_bootstrap import Bootstrap
from flask... | true | true |
790342b593f0f9fff35264ceb740ba6906b02f8a | 76 | py | Python | ABC026/ABC026f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC026/ABC026f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC026/ABC026f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | #ABC026f
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| 15.2 | 28 | 0.789474 |
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| true | true |
790343765cc55c5f9c2ca1f2b92ec280603bcf7a | 7,451 | py | Python | examples/benchmark/utils/recommendation/ncf_input_pipeline.py | Ezra-H/autodist | b5ab28d0d867c22742daa3c1d324fe20c1852bd7 | [
"Apache-2.0"
] | 127 | 2020-07-16T16:33:10.000Z | 2022-03-25T09:58:50.000Z | examples/benchmark/utils/recommendation/ncf_input_pipeline.py | Ezra-H/autodist | b5ab28d0d867c22742daa3c1d324fe20c1852bd7 | [
"Apache-2.0"
] | 17 | 2020-07-16T20:03:44.000Z | 2021-02-24T19:53:12.000Z | examples/benchmark/utils/recommendation/ncf_input_pipeline.py | Ezra-H/autodist | b5ab28d0d867c22742daa3c1d324fe20c1852bd7 | [
"Apache-2.0"
] | 26 | 2020-07-21T01:23:55.000Z | 2022-02-24T03:43:08.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.84492 | 82 | 0.668232 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import tensorflow.compat.v2 as tf
from utils.recommendation import constants as rconst
from utils.recommendation import movielens
from utils.recommendation import data_pipeli... | true | true |
790344d0c93753e114d72a64fc03c1ca4da837f6 | 855 | py | Python | zinnia/views/mixins/entry_preview.py | julienc91/django-blog-zinnia | b4949304b104a8e1a7a7a0773cbfd024313c3a15 | [
"BSD-3-Clause"
] | 10 | 2020-03-04T05:32:09.000Z | 2020-03-04T05:49:52.000Z | zinnia/views/mixins/entry_preview.py | julienc91/django-blog-zinnia | b4949304b104a8e1a7a7a0773cbfd024313c3a15 | [
"BSD-3-Clause"
] | 9 | 2017-05-09T02:00:31.000Z | 2017-06-12T11:08:26.000Z | zinnia/views/mixins/entry_preview.py | julienc91/django-blog-zinnia | b4949304b104a8e1a7a7a0773cbfd024313c3a15 | [
"BSD-3-Clause"
] | null | null | null | """Preview mixins for Zinnia views"""
from django.http import Http404
from django.utils.translation import ugettext as _
class EntryPreviewMixin(object):
"""
Mixin implementing the preview of Entries.
"""
def get_object(self, queryset=None):
"""
If the status of the entry is not PUBLI... | 32.884615 | 65 | 0.62924 | from django.http import Http404
from django.utils.translation import ugettext as _
class EntryPreviewMixin(object):
def get_object(self, queryset=None):
obj = super(EntryPreviewMixin, self).get_object(queryset)
if obj.is_visible:
return obj
if (self.request.user.has_perm('zinn... | true | true |
79034548ec1d838f35e1240aed74d123fc9e3469 | 5,176 | py | Python | src/stt.py | microsoft/SpeechServices | 9509a1ca01b5c4628dd11ce8e4840561d4d1e693 | [
"MIT"
] | null | null | null | src/stt.py | microsoft/SpeechServices | 9509a1ca01b5c4628dd11ce8e4840561d4d1e693 | [
"MIT"
] | null | null | null | src/stt.py | microsoft/SpeechServices | 9509a1ca01b5c4628dd11ce8e4840561d4d1e693 | [
"MIT"
] | null | null | null | ''' SPEECH-TO-TEXT USING MICROSOFT SPEECH API '''
''' nonstoptimm@gmail.com '''
# Import required packages
import os
import glob
import json
import logging
import codecs
import helper as he
import azure.cognitiveservices.speech as speechsdk
import params as pa
# Load and set configuration parameters
pa.get_config()
... | 45.008696 | 131 | 0.701893 |
import os
import glob
import json
import logging
import codecs
import helper as he
import azure.cognitiveservices.speech as speechsdk
import params as pa
pa.get_config()
def request_endpoint(audio, speech_config, output_directory, lexical):
audio_config = speechsdk.audio.AudioConfig(filename = audio)
speec... | true | true |
790345629c935e83bea283f2d5a9e53f07e212f4 | 4,367 | py | Python | tests/test_unicode.py | astrojuanlu/Fiona | 766a4598462efd5e3b819a0ede0900bc7f9ac9c1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_unicode.py | astrojuanlu/Fiona | 766a4598462efd5e3b819a0ede0900bc7f9ac9c1 | [
"BSD-3-Clause"
] | null | null | null | tests/test_unicode.py | astrojuanlu/Fiona | 766a4598462efd5e3b819a0ede0900bc7f9ac9c1 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
import logging
import os
import shutil
import sys
import tempfile
import unittest
import pytest
import fiona
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
class UnicodePathTest(unittest.TestCase):
def setUp(self):
tempdir = tempfile.mkdtemp()
self.dir = os.path.jo... | 34.936 | 77 | 0.53973 |
import logging
import os
import shutil
import sys
import tempfile
import unittest
import pytest
import fiona
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
class UnicodePathTest(unittest.TestCase):
def setUp(self):
tempdir = tempfile.mkdtemp()
self.dir = os.path.join(tempdir, 'fr... | true | true |
790347682b5d900b563ebd9a546cfa50d6a212c3 | 6,427 | py | Python | docs/source/conf.py | lukapecnik/NiaPy | a40ac08a4c06a13019ec5e39cc137461884928b0 | [
"MIT"
] | 1 | 2020-03-16T11:15:43.000Z | 2020-03-16T11:15:43.000Z | docs/source/conf.py | lukapecnik/NiaPy | a40ac08a4c06a13019ec5e39cc137461884928b0 | [
"MIT"
] | null | null | null | docs/source/conf.py | lukapecnik/NiaPy | a40ac08a4c06a13019ec5e39cc137461884928b0 | [
"MIT"
] | 1 | 2020-03-25T16:20:36.000Z | 2020-03-25T16:20:36.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 31.816832 | 180 | 0.67232 |
import os
import sys
sys.path.insert(0, os.path.abspath('../../'))
print(sys.path)
project = u'NiaPy'
copyright = u'2018, NiaOrg'
author = u'Grega Vrbančič, Lucija Brezočnik, Uroš Mlakar, Dušan Fister, Iztok Fister Jr., Klemen Berkovič, Jan Popič'
version = u''
release = u'0.0.0.'
extens... | true | true |
790347b2c5ec555882e4f6d27b4803a4abbedce4 | 1,281 | py | Python | databench/analyses_packaged/dummypi/analysis.py | svenkreiss/databench | 99d4adad494b60a42af6b8bfba94dd0c41ba0786 | [
"MIT"
] | 61 | 2015-01-07T18:03:21.000Z | 2020-11-23T03:31:54.000Z | databench/analyses_packaged/dummypi/analysis.py | phillipaug/Data-Analysis-General-repository | 99d4adad494b60a42af6b8bfba94dd0c41ba0786 | [
"MIT"
] | 9 | 2015-02-25T15:56:28.000Z | 2019-03-13T15:16:20.000Z | databench/analyses_packaged/dummypi/analysis.py | phillipaug/Data-Analysis-General-repository | 99d4adad494b60a42af6b8bfba94dd0c41ba0786 | [
"MIT"
] | 15 | 2015-01-07T10:53:59.000Z | 2020-02-28T05:02:00.000Z | from __future__ import division
import databench
import math
import random
class Dummypi(databench.Analysis):
"""A dummy analysis."""
@databench.on
def connected(self):
yield self.data.init({'samples': 100000})
@databench.on
def run(self):
"""Run when button is pressed."""
... | 26.142857 | 79 | 0.527713 | from __future__ import division
import databench
import math
import random
class Dummypi(databench.Analysis):
@databench.on
def connected(self):
yield self.data.init({'samples': 100000})
@databench.on
def run(self):
inside = 0
for draws in range(1, self.data['samples']):
... | true | true |
79034931f44beb14fe594976eaf4f6977d7e2c73 | 1,928 | py | Python | wagtail_storages/tests/test_utils.py | ski-family/wagtail-storages | 2786b55540eb7045c87460a885176c45c9afab53 | [
"BSD-2-Clause"
] | 26 | 2019-12-04T09:45:26.000Z | 2021-12-02T17:17:31.000Z | wagtail_storages/tests/test_utils.py | ski-family/wagtail-storages | 2786b55540eb7045c87460a885176c45c9afab53 | [
"BSD-2-Clause"
] | 20 | 2019-12-05T10:45:35.000Z | 2022-02-21T16:03:49.000Z | wagtail_storages/tests/test_utils.py | ski-family/wagtail-storages | 2786b55540eb7045c87460a885176c45c9afab53 | [
"BSD-2-Clause"
] | 5 | 2019-12-04T14:35:45.000Z | 2021-12-16T07:48:37.000Z | from django.test import TestCase, override_settings
from wagtail_storages.factories import (
CollectionFactory,
CollectionViewRestrictionFactory,
)
from wagtail_storages.utils import (
get_acl_for_collection,
get_frontend_cache_configuration,
is_s3_boto3_storage_used,
)
class TestIsS3Boto3Storage... | 33.824561 | 87 | 0.693983 | from django.test import TestCase, override_settings
from wagtail_storages.factories import (
CollectionFactory,
CollectionViewRestrictionFactory,
)
from wagtail_storages.utils import (
get_acl_for_collection,
get_frontend_cache_configuration,
is_s3_boto3_storage_used,
)
class TestIsS3Boto3Storage... | true | true |
790349e7536ecbcf94ff9781fa1d4db9df54005a | 6,913 | py | Python | testing.py | sunil1239/FuelEfficiencyInfo | 7f036b6cfdb120668e940519ca426f4c6794a98b | [
"Unlicense"
] | null | null | null | testing.py | sunil1239/FuelEfficiencyInfo | 7f036b6cfdb120668e940519ca426f4c6794a98b | [
"Unlicense"
] | null | null | null | testing.py | sunil1239/FuelEfficiencyInfo | 7f036b6cfdb120668e940519ca426f4c6794a98b | [
"Unlicense"
] | null | null | null | from PySide import QtGui, QtCore
import os, subprocess, shutil, re
class animQt(QtGui.QMainWindow):
def __init__(self):
super(animQt, self).__init__()
self.setGeometry(250,250,360,100)
style = """
QMainWindow, QMessageBox{
background-color: qradialgradient(spread:pad, cx:0.... | 39.959538 | 202 | 0.592362 | from PySide import QtGui, QtCore
import os, subprocess, shutil, re
class animQt(QtGui.QMainWindow):
def __init__(self):
super(animQt, self).__init__()
self.setGeometry(250,250,360,100)
style = """
QMainWindow, QMessageBox{
background-color: qradialgradient(spread:pad, cx:0.... | true | true |
79034b377e53dbe27bcfc9791d8775eae11ab645 | 4,532 | py | Python | notebook-samples/unsupervised/pred_electricity_consumption.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | 1 | 2020-07-21T23:24:25.000Z | 2020-07-21T23:24:25.000Z | notebook-samples/unsupervised/pred_electricity_consumption.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | 4 | 2021-06-29T00:38:57.000Z | 2022-01-15T00:22:15.000Z | notebook-samples/unsupervised/pred_electricity_consumption.py | MarkMoretto/python-examples-main | 37b8c41d2f175029f4536ca970f037ff19b4e951 | [
"MIT"
] | null | null | null |
"""
Purpose: Unsupervised learning sampler
Date created: 2020-11-06
Ref repo: https://github.com/White-Link/UnsupervisedScalableRepresentationLearningTimeSeries
Local folder: C:/Users/Work1/Desktop/Info/GitHub/python-examples-main/notebook-samples/unsupervised
Contributor(s):
Mark M.
"""
import os
from pathlib... | 23.978836 | 115 | 0.703442 |
import os
from pathlib import Path
myuser = os.environ["username"]
PROJECT_FOLDER = Path(rf"C:\Users\{myuser}\Desktop\Info\GitHub\python-examples-main\notebook-samples\unsupervised")
os.chdir(PROJECT_FOLDER)
from UnsupervisedTSRepo import scikit_wrappers
import gc
import zipfile
import requests
from io import By... | true | true |
79034cd6ecd7727ce9e7cf45eacbe59cb3197f5c | 3,218 | py | Python | find_schedule.py | jason-sa/Toucans | b463817426702eef470c8973102703d71274c235 | [
"MIT"
] | 1 | 2018-09-27T21:04:08.000Z | 2018-09-27T21:04:08.000Z | 1-Benson_Project/find_schedule.py | Stitchmaker/Metis_Bootcamp | d5ba3b215482cb1044e6b38833068ba93f2852f3 | [
"MIT"
] | null | null | null | 1-Benson_Project/find_schedule.py | Stitchmaker/Metis_Bootcamp | d5ba3b215482cb1044e6b38833068ba93f2852f3 | [
"MIT"
] | 1 | 2018-10-14T01:55:47.000Z | 2018-10-14T01:55:47.000Z | import pandas as pd
import read_mta_turnstile as t
# This function generally generates a schedule for all stations in the df_top.csv file in a pivot table format.
def find_schedule():
# Read the stations with highest Toucan scores and select columns relavant
# to our schedule algorithm
top_stations = pd.re... | 51.903226 | 111 | 0.678061 | import pandas as pd
import read_mta_turnstile as t
def find_schedule():
top_stations = pd.read_csv('df_top.csv')
top_stations.rename(columns={'name':'STATION'}, inplace = True)
top_stations1 = top_stations.loc[:,['STATION','toucan_score']]
turnstile_data = t.read_mta_turnstile(... | true | true |
79034d00af5409d64978ded6af61a9b54a7c4936 | 4,215 | py | Python | utils/eval.py | Curli-quan/oneshot-medical-landmark | 572926077fffbe9832aa16baa98bd046ec326700 | [
"Apache-2.0"
] | 7 | 2021-12-18T17:08:15.000Z | 2022-03-02T14:08:12.000Z | utils/eval.py | Curli-quan/oneshot-medical-landmark | 572926077fffbe9832aa16baa98bd046ec326700 | [
"Apache-2.0"
] | 2 | 2021-12-19T20:28:22.000Z | 2021-12-28T05:17:47.000Z | utils/eval.py | Curli-quan/oneshot-medical-landmark | 572926077fffbe9832aa16baa98bd046ec326700 | [
"Apache-2.0"
] | 1 | 2022-03-19T15:08:16.000Z | 2022-03-19T15:08:16.000Z | import numpy as np
from .utils import make_dir
class Evaluater(object):
def __init__(self, logger, size, original_size, tag='paper_figure'):
self.pixel_spaceing = 0.1
self.tag = tag
make_dir(tag)
self.tag += '/'
self.logger = logger
self.scale_rate_y ... | 37.300885 | 86 | 0.530724 | import numpy as np
from .utils import make_dir
class Evaluater(object):
def __init__(self, logger, size, original_size, tag='paper_figure'):
self.pixel_spaceing = 0.1
self.tag = tag
make_dir(tag)
self.tag += '/'
self.logger = logger
self.scale_rate_y ... | true | true |
79034d4a700d76f45ff8a416cf194f3fa8e5cc19 | 2,723 | py | Python | recstudio/model/seq/hgn.py | ustc-recsys/Torchrec | 4d62ee42018c12961850936cfd8f4f8d3c6a8dbc | [
"MIT"
] | 1 | 2021-11-13T12:12:54.000Z | 2021-11-13T12:12:54.000Z | recstudio/model/seq/hgn.py | ustc-recsys/Torchrec | 4d62ee42018c12961850936cfd8f4f8d3c6a8dbc | [
"MIT"
] | null | null | null | recstudio/model/seq/hgn.py | ustc-recsys/Torchrec | 4d62ee42018c12961850936cfd8f4f8d3c6a8dbc | [
"MIT"
] | null | null | null | import torch
from recstudio.ann import sampler
from recstudio.data import dataset
from recstudio.model import basemodel, loss_func, scorer
r"""
HGN
########
Paper Reference:
Chen ma, et al. "HGN: Hierarchical Gating Networks for Sequential Recommendation" in KDD2019.
https://dl.acm.org/doi/abs/10.1145/3292500... | 36.797297 | 120 | 0.662505 | import torch
from recstudio.ann import sampler
from recstudio.data import dataset
from recstudio.model import basemodel, loss_func, scorer
class HGNQueryEncoder(torch.nn.Module):
def __init__(self, fuid, fiid, num_users, embed_dim, max_seq_len, item_encoder, pooling_type='mean') -> None:
super().__in... | true | true |
79034d720a9797a0961ffc28129dfb20eb5e848d | 668 | py | Python | articles/models.py | Blaise-design/Django-Hospital-Project | 30572cef02be343eda50390ca6bd1f239a37d9c1 | [
"MIT"
] | 2 | 2020-04-22T06:31:18.000Z | 2020-06-16T05:03:16.000Z | articles/models.py | Blaise-design/Django-Hospital-Project | 30572cef02be343eda50390ca6bd1f239a37d9c1 | [
"MIT"
] | null | null | null | articles/models.py | Blaise-design/Django-Hospital-Project | 30572cef02be343eda50390ca6bd1f239a37d9c1 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.utils import timezone
# Create your models here.
class Article(models.Model):
title=models.CharField(max_length=100)
slug=models.SlugField(blank=True)
body= models.TextField()
... | 31.809524 | 77 | 0.685629 | from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
from django.utils import timezone
class Article(models.Model):
title=models.CharField(max_length=100)
slug=models.SlugField(blank=True)
body= models.TextField()
date= models.DateTim... | true | true |
79034d78000be728f4c26f055790a32ed78837e8 | 2,676 | py | Python | compiler_idioms/idiom/implementations/remainder_signed_todo.py | fkie-cad/pidarci | 7c9ab0af202c675fae3af8f7f27bbde7aa3eea40 | [
"MIT"
] | null | null | null | compiler_idioms/idiom/implementations/remainder_signed_todo.py | fkie-cad/pidarci | 7c9ab0af202c675fae3af8f7f27bbde7aa3eea40 | [
"MIT"
] | null | null | null | compiler_idioms/idiom/implementations/remainder_signed_todo.py | fkie-cad/pidarci | 7c9ab0af202c675fae3af8f7f27bbde7aa3eea40 | [
"MIT"
] | null | null | null | import json
from typing import List, Dict
from icecream import ic
from compiler_idioms.idiom.instruction_sequence import InstructionSequence
from compiler_idioms.idiom.utils.magic import compute_magic_numbers_if_not_exists
from compiler_idioms.instruction import from_anonymized_pattern, Instruction
from compiler_idio... | 40.545455 | 131 | 0.67713 | import json
from typing import List, Dict
from icecream import ic
from compiler_idioms.idiom.instruction_sequence import InstructionSequence
from compiler_idioms.idiom.utils.magic import compute_magic_numbers_if_not_exists
from compiler_idioms.instruction import from_anonymized_pattern, Instruction
from compiler_idio... | true | true |
79034e703aa4db0e2d015ab307a41a96377bd4b5 | 6,173 | py | Python | wbml/data/data.py | wesselb/wbml | 06bf71777ab9a75ef71845f95f91755626b37ddf | [
"MIT"
] | 4 | 2019-12-04T11:30:34.000Z | 2022-02-24T09:16:28.000Z | wbml/data/data.py | wesselb/wbml | 06bf71777ab9a75ef71845f95f91755626b37ddf | [
"MIT"
] | null | null | null | wbml/data/data.py | wesselb/wbml | 06bf71777ab9a75ef71845f95f91755626b37ddf | [
"MIT"
] | 1 | 2018-10-14T13:10:39.000Z | 2018-10-14T13:10:39.000Z | import datetime
import os
import shutil
import subprocess
import urllib.request
from contextlib import closing
import numpy as np
import pandas as pd
import requests
import wbml.out
__all__ = [
"DependencyError",
"resource",
"dependency",
"asserted_dependency",
"split_df",
"data_path",
"d... | 31.176768 | 82 | 0.599708 | import datetime
import os
import shutil
import subprocess
import urllib.request
from contextlib import closing
import numpy as np
import pandas as pd
import requests
import wbml.out
__all__ = [
"DependencyError",
"resource",
"dependency",
"asserted_dependency",
"split_df",
"data_path",
"d... | true | true |
79034ec9623865f932bf2486fb45c24b26b52d42 | 2,208 | py | Python | leetcode.com/python/98_Validate_Binary_Search_Tree.py | XSoyOscar/Algorithms | 6e1626d4b0f7804494f0a651698966ad6fd0fe18 | [
"MIT"
] | 713 | 2019-11-19T16:11:25.000Z | 2022-03-31T02:27:52.000Z | leetcode.com/python/98_Validate_Binary_Search_Tree.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 7 | 2020-01-16T17:07:18.000Z | 2021-11-15T18:24:39.000Z | leetcode.com/python/98_Validate_Binary_Search_Tree.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 393 | 2019-11-18T17:55:45.000Z | 2022-03-28T20:26:32.000Z | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class BST:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
# Average: O(log(n)) time | O... | 30.666667 | 86 | 0.578804 |
class BST:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
def insert(self, val):
currentNode = self
while True:
if val < currentNode.val:
if currentNode.left is None:
currentNode.l... | true | true |
79034f6c6c9dc438a9c2515124b624638a9505d1 | 19,318 | py | Python | veracode_api_py/api.py | DaYuM/veracode-api-py | 12965d8919d9a7752398e7cd19bdcc4a81bc3c9e | [
"MIT"
] | null | null | null | veracode_api_py/api.py | DaYuM/veracode-api-py | 12965d8919d9a7752398e7cd19bdcc4a81bc3c9e | [
"MIT"
] | null | null | null | veracode_api_py/api.py | DaYuM/veracode-api-py | 12965d8919d9a7752398e7cd19bdcc4a81bc3c9e | [
"MIT"
] | null | null | null | # Purpose: API utilities
#
# Notes: API credentials must be enabled on Veracode account and placed in ~/.veracode/credentials like
#
# [default]
# veracode_api_key_id = <YOUR_API_KEY_ID>
# veracode_api_key_secret = <YOUR_API_KEY_SECRET>
#
# and file permission set appropriate... | 39.184584 | 180 | 0.747904 |
import requests
import logging
from requests.adapters import HTTPAdapter
from typing import List
from veracode_api_signing.exceptions import VeracodeAPISigningException
from veracode_api_signing.plugin_requests import RequestsAuthPluginVeracodeHMAC
from .constants import Constants
from .exceptions import Ve... | true | true |
790350441e4dd00cf820b2bcd99e03d0cf57cb67 | 8,010 | py | Python | helper_servers/http_forwarder.py | stephenbradshaw/pentesting_stuff | be14765aa6c435e9a41b0a680d259fc0495c6ff1 | [
"BSD-3-Clause"
] | 14 | 2018-07-21T02:56:10.000Z | 2022-01-15T16:00:07.000Z | helper_servers/http_forwarder.py | stephenbradshaw/pentesting_stuff | be14765aa6c435e9a41b0a680d259fc0495c6ff1 | [
"BSD-3-Clause"
] | null | null | null | helper_servers/http_forwarder.py | stephenbradshaw/pentesting_stuff | be14765aa6c435e9a41b0a680d259fc0495c6ff1 | [
"BSD-3-Clause"
] | 4 | 2017-11-16T16:06:15.000Z | 2019-01-17T08:43:59.000Z | #!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
import sys
import urllib
import logging
from optparse import OptionParser
class ResultsProvider(object):
'''Base class used to fetch data from server for forwarding'''
import requests
import socket
import time
def __init__(self, *... | 37.605634 | 129 | 0.607241 |
import SimpleHTTPServer
import SocketServer
import sys
import urllib
import logging
from optparse import OptionParser
class ResultsProvider(object):
'''Base class used to fetch data from server for forwarding'''
import requests
import socket
import time
def __init__(self, **kwargs):
'''... | false | true |
790350ad5fa9f011c6bd6a86b1a5e229de30fae8 | 2,388 | py | Python | amime/modules/anime/TV-SHORT/tvshort_trend/TVSHORT_TREND/tvshort_trend7.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | amime/modules/anime/TV-SHORT/tvshort_trend/TVSHORT_TREND/tvshort_trend7.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | amime/modules/anime/TV-SHORT/tvshort_trend/TVSHORT_TREND/tvshort_trend7.py | Myudi422/ccgnime_req | a0f7596ba101204539b4120dffa08912b6560efe | [
"MIT"
] | null | null | null | import httpx
from anilist.types import Anime
from pyrogram import filters
from pyrogram.types import CallbackQuery
from pyromod.helpers import ikb
from pyromod.nav import Pagination
from amime.amime import Amime
@Amime.on_callback_query(filters.regex(r"^tvshort_trending7 anime (?P<page>\d+)"))
async def anime_sugges... | 32.27027 | 105 | 0.490787 | import httpx
from anilist.types import Anime
from pyrogram import filters
from pyrogram.types import CallbackQuery
from pyromod.helpers import ikb
from pyromod.nav import Pagination
from amime.amime import Amime
@Amime.on_callback_query(filters.regex(r"^tvshort_trending7 anime (?P<page>\d+)"))
async def anime_sugges... | true | true |
790351a15bdffbda5883270d588a916d0ed8ddd6 | 2,845 | py | Python | training/test/test_metric_logger.py | sbam13/open_lth | d8c8d450cc8229afed54b26f77b91c3fe0c3f339 | [
"MIT"
] | null | null | null | training/test/test_metric_logger.py | sbam13/open_lth | d8c8d450cc8229afed54b26f77b91c3fe0c3f339 | [
"MIT"
] | null | null | null | training/test/test_metric_logger.py | sbam13/open_lth | d8c8d450cc8229afed54b26f77b91c3fe0c3f339 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from foundations.step import Step
from training.metric_logger import MetricLogger
from testing import test_case
class ... | 41.231884 | 96 | 0.660105 |
import os
from foundations.step import Step
from training.metric_logger import MetricLogger
from testing import test_case
class TestMetricLogger(test_case.TestCase):
def test_create(self):
MetricLogger()
@staticmethod
def create_logger():
logger = MetricLogger()
... | true | true |
79035325aebf7481cbae87dad61d5abc35502bc0 | 4,531 | py | Python | utils/metrics.py | ljzycmd/SimDeblur | dd2f60c41176b75c4eaf80d740f547c206aa8227 | [
"MIT"
] | 190 | 2021-03-22T13:59:42.000Z | 2022-03-08T21:14:41.000Z | utils/metrics.py | Wang-jiahao/SimDeblur | 31d88e1fbec91d5cc9062f4a46538e4ba806ab29 | [
"MIT"
] | 9 | 2021-04-26T06:44:40.000Z | 2022-03-25T07:48:30.000Z | utils/metrics.py | Wang-jiahao/SimDeblur | 31d88e1fbec91d5cc9062f4a46538e4ba806ab29 | [
"MIT"
] | 27 | 2021-03-23T03:11:00.000Z | 2022-03-19T21:26:02.000Z | # CMD
import torch
import torch.nn.functional as F
import cv2
def calculate_psnr(img1, img2):
"""
data range [0, 1]
"""
img1 = img1.clamp(0, 1)
img2 = img2.clamp(0, 1)
mse = torch.mean((img1 - img2) ** 2, [1, 2, 3])
# if mse == 0:
# return 100
PIXEL_MAX = 1
return 20 * to... | 33.813433 | 117 | 0.609137 |
import torch
import torch.nn.functional as F
import cv2
def calculate_psnr(img1, img2):
img1 = img1.clamp(0, 1)
img2 = img2.clamp(0, 1)
mse = torch.mean((img1 - img2) ** 2, [1, 2, 3])
PIXEL_MAX = 1
return 20 * torch.mean(torch.log10(PIXEL_MAX / torch.sqrt(mse)))
def calculate_ssim(i... | true | true |
790354328b4bbc6897980046f5649be0ca6d7552 | 2,459 | py | Python | simplegist/simplegist.py | acatiadroid/simplegist | ae677872219d0697abf1fdc726e1a15470e3324f | [
"MIT"
] | null | null | null | simplegist/simplegist.py | acatiadroid/simplegist | ae677872219d0697abf1fdc726e1a15470e3324f | [
"MIT"
] | null | null | null | simplegist/simplegist.py | acatiadroid/simplegist | ae677872219d0697abf1fdc726e1a15470e3324f | [
"MIT"
] | null | null | null | import requests
import json
from simplegist.mygist import Mygist
from simplegist.do import Do
from comments import Comments
try:
from simplegist.config import USERNAME, API_TOKEN, BASE_URL, GIST_URL
except:
pass
class Simplegist:
"""
Gist Base Class
This class is to used to instantiate the wrapper and authentica... | 22.981308 | 97 | 0.646604 | import requests
import json
from simplegist.mygist import Mygist
from simplegist.do import Do
from comments import Comments
try:
from simplegist.config import USERNAME, API_TOKEN, BASE_URL, GIST_URL
except:
pass
class Simplegist:
def __init__(self, **args):
if 'username' in args:
self.username = args['user... | true | true |
790355fc2c17677f74f2230fbf2c11be027f4021 | 3,143 | py | Python | configs/textdet/dbnet/dbnet_r18_fpnc_1200e_icdar2015.py | jeffreykuang/mmocr-1 | b17304edeb493b0a4d7224c23d23b952350d0db5 | [
"Apache-2.0"
] | 206 | 2021-07-30T09:04:08.000Z | 2022-03-22T00:57:44.000Z | configs/textdet/dbnet/dbnet_r18_fpnc_1200e_icdar2015.py | jeffreykuang/mmocr-1 | b17304edeb493b0a4d7224c23d23b952350d0db5 | [
"Apache-2.0"
] | 39 | 2021-08-05T07:16:46.000Z | 2022-03-14T13:23:48.000Z | configs/textdet/dbnet/dbnet_r18_fpnc_1200e_icdar2015.py | jeffreykuang/mmocr-1 | b17304edeb493b0a4d7224c23d23b952350d0db5 | [
"Apache-2.0"
] | 61 | 2021-07-30T07:51:41.000Z | 2022-03-30T14:40:02.000Z | _base_ = [
'../../_base_/schedules/schedule_1200e.py', '../../_base_/runtime_10e.py'
]
model = dict(
type='DBNet',
pretrained='torchvision://resnet18',
backbone=dict(
type='ResNet',
depth=18,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=-1,
norm_c... | 32.402062 | 77 | 0.596564 | _base_ = [
'../../_base_/schedules/schedule_1200e.py', '../../_base_/runtime_10e.py'
]
model = dict(
type='DBNet',
pretrained='torchvision://resnet18',
backbone=dict(
type='ResNet',
depth=18,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=-1,
norm_c... | true | true |
790358237c023b381ab2848aabf942a0bd5444c7 | 2,678 | py | Python | app/webhooks.py | heaptracetechnology/github | 7b7eaddf2e2eec4d28855c81d68ded65dc05cc09 | [
"MIT"
] | null | null | null | app/webhooks.py | heaptracetechnology/github | 7b7eaddf2e2eec4d28855c81d68ded65dc05cc09 | [
"MIT"
] | null | null | null | app/webhooks.py | heaptracetechnology/github | 7b7eaddf2e2eec4d28855c81d68ded65dc05cc09 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import hmac
import requests
from json import dumps
from hashlib import sha1
from .app import api, env
def match_any_if_any(event, events):
return events is None or event in events
class Subscription:
def __init__(self, data):
self.data = data
self.events = data['dat... | 26.78 | 76 | 0.590739 |
import hmac
import requests
from json import dumps
from hashlib import sha1
from .app import api, env
def match_any_if_any(event, events):
return events is None or event in events
class Subscription:
def __init__(self, data):
self.data = data
self.events = data['data'].get('events')
... | true | true |
79035892a4162456def659cca8b6309091fcea3c | 1,573 | py | Python | ENV/lib/python3.5/site-packages/pyrogram/api/types/channel_admin_log_event_action_toggle_pre_history_hidden.py | block1o1/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 4 | 2021-10-14T21:22:25.000Z | 2022-03-12T19:58:48.000Z | ENV/lib/python3.5/site-packages/pyrogram/api/types/channel_admin_log_event_action_toggle_pre_history_hidden.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | null | null | null | ENV/lib/python3.5/site-packages/pyrogram/api/types/channel_admin_log_event_action_toggle_pre_history_hidden.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 1 | 2022-03-15T22:52:53.000Z | 2022-03-15T22:52:53.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free S... | 29.12963 | 86 | 0.686586 |
from io import BytesIO
from pyrogram.api.core import *
class ChannelAdminLogEventActionTogglePreHistoryHidden(Object):
ID = 0x5f5c95f1
def __init__(self, new_value: bool):
self.new_value = new_value
@staticmethod
def read(b: BytesIO, *args) -> "ChannelAdminLogEventActio... | true | true |
79035898aeb438851c67166a71b8be4f337540ee | 1,903 | py | Python | mmdet/datasets/classify/imagenet.py | anorthman/mmdetection | 52e28154364f0e19d11c206bb357d88f29fc4a2d | [
"Apache-2.0"
] | 5 | 2019-06-11T11:08:54.000Z | 2021-03-25T10:06:01.000Z | mmdet/datasets/classify/imagenet.py | anorthman/mmdetection | 52e28154364f0e19d11c206bb357d88f29fc4a2d | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/classify/imagenet.py | anorthman/mmdetection | 52e28154364f0e19d11c206bb357d88f29fc4a2d | [
"Apache-2.0"
] | 1 | 2019-06-11T11:08:55.000Z | 2019-06-11T11:08:55.000Z | import os
import cv2
from PIL import Image
import torch
import mmcv
import numpy as np
from torch.utils.data import Dataset
import torchvision.transforms as T
from torchvision.datasets import ImageFolder
class ImageNetDataset(Dataset):
def __init__(self,
data_root,
test_mode=Fa... | 32.254237 | 104 | 0.504467 | import os
import cv2
from PIL import Image
import torch
import mmcv
import numpy as np
from torch.utils.data import Dataset
import torchvision.transforms as T
from torchvision.datasets import ImageFolder
class ImageNetDataset(Dataset):
def __init__(self,
data_root,
test_mode=Fa... | true | true |
790359ff366f72c211193c96a4f53c88177863f3 | 7,772 | py | Python | payir/models.py | farahmand-m/django-payir | c6f1042cf9fa3b1887086cedfacc5f76755540be | [
"MIT"
] | null | null | null | payir/models.py | farahmand-m/django-payir | c6f1042cf9fa3b1887086cedfacc5f76755540be | [
"MIT"
] | null | null | null | payir/models.py | farahmand-m/django-payir | c6f1042cf9fa3b1887086cedfacc5f76755540be | [
"MIT"
] | null | null | null | from django.db import models
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.shortcuts import redirect
from django.urls import reverse
from django.utils import timezone
import requests
from . import exceptions
class Gateway(models.Model):
label = models.CharFie... | 55.913669 | 190 | 0.702651 | from django.db import models
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.shortcuts import redirect
from django.urls import reverse
from django.utils import timezone
import requests
from . import exceptions
class Gateway(models.Model):
label = models.CharFie... | true | true |
79035a03cb0b0c6594b1eb3fb61d98f3df969eaa | 830 | py | Python | lexicon/tests/providers/test_glesys.py | HelixEducation/lexicon | 9941a61a3b208c5b35602432a75a814394e34875 | [
"MIT"
] | null | null | null | lexicon/tests/providers/test_glesys.py | HelixEducation/lexicon | 9941a61a3b208c5b35602432a75a814394e34875 | [
"MIT"
] | null | null | null | lexicon/tests/providers/test_glesys.py | HelixEducation/lexicon | 9941a61a3b208c5b35602432a75a814394e34875 | [
"MIT"
] | 1 | 2020-07-13T21:45:08.000Z | 2020-07-13T21:45:08.000Z | """Integration tests for Glesys"""
from unittest import TestCase
import pytest
from lexicon.tests.providers.integration_tests import IntegrationTestsV1
# Hook into testing framework by inheriting unittest.TestCase and reuse
# the tests which *each and every* implementation of the interface must
# pass, by inheritanc... | 34.583333 | 91 | 0.774699 | from unittest import TestCase
import pytest
from lexicon.tests.providers.integration_tests import IntegrationTestsV1
class GlesysProviderTests(TestCase, IntegrationTestsV1):
provider_name = 'glesys'
domain = "capsulecd.com"
def _filter_headers(self):
return ['Authorization']
@pytes... | true | true |
79035ae7fc48491090144047e32494f56c714f32 | 888 | py | Python | priestess.py | nvanbaak/dungeon-adventure-2 | 8bb3efbcf375baa149df85172b7d715d5a2930a8 | [
"MIT"
] | null | null | null | priestess.py | nvanbaak/dungeon-adventure-2 | 8bb3efbcf375baa149df85172b7d715d5a2930a8 | [
"MIT"
] | null | null | null | priestess.py | nvanbaak/dungeon-adventure-2 | 8bb3efbcf375baa149df85172b7d715d5a2930a8 | [
"MIT"
] | null | null | null | # name : Shoby Gnanasekaran
# net id: shoby
from dungeonchar import DungeonCharacter
from healable import Healable
from hero import Hero
class Priestess(Hero, Healable):
""" Priestess is a hero with it own statistics. The basic behaviour is same as the hero.
Special ability is to heal everytime after taking ... | 35.52 | 92 | 0.679054 |
from dungeonchar import DungeonCharacter
from healable import Healable
from hero import Hero
class Priestess(Hero, Healable):
def __init__(self, name, model, **kwargs):
super().__init__(name = name, model = model, **kwargs)
super(DungeonCharacter, self).__init__(**kwargs)
def take_damage(se... | true | true |
79036004fea28c4dba4e834e26c516912938e6de | 713 | py | Python | web_service/config.py | celinekeisja/capstone | 446201dc1aa60203b1f43995998846367bc18c7a | [
"MIT"
] | null | null | null | web_service/config.py | celinekeisja/capstone | 446201dc1aa60203b1f43995998846367bc18c7a | [
"MIT"
] | 4 | 2021-03-31T19:33:29.000Z | 2021-12-13T20:52:17.000Z | web_service/config.py | celinekeisja/capstone | 446201dc1aa60203b1f43995998846367bc18c7a | [
"MIT"
] | null | null | null | import os
from connexion import App
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
basedir = os.path.abspath(os.path.dirname(__file__))
conn = App(__name__, specification_dir='./')
app = conn.app
postgres_url = 'postgres://postgres:docker@10.5.95.65:54320/web_service_db'
app.conf... | 25.464286 | 75 | 0.760168 | import os
from connexion import App
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
basedir = os.path.abspath(os.path.dirname(__file__))
conn = App(__name__, specification_dir='./')
app = conn.app
postgres_url = 'postgres://postgres:docker@10.5.95.65:54320/web_service_db'
app.conf... | true | true |
790360736808ec71a85aa153b300c50a926d3ce6 | 1,107 | py | Python | tests/unit/__init__.py | stefwalter/packit | d675018518ef200a06ea7636dd203100d872a772 | [
"MIT"
] | 1 | 2020-12-28T18:00:22.000Z | 2020-12-28T18:00:22.000Z | tests/unit/__init__.py | stefwalter/packit | d675018518ef200a06ea7636dd203100d872a772 | [
"MIT"
] | 7 | 2020-12-28T19:57:35.000Z | 2021-04-17T14:43:15.000Z | tests/unit/__init__.py | stefwalter/packit | d675018518ef200a06ea7636dd203100d872a772 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2019 Red Hat, Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... | 50.318182 | 80 | 0.775971 | true | true | |
7903619646d14bbb5481225fca4a3723bcdcbbbc | 1,115 | py | Python | web/addons/stock/__init__.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | 1 | 2019-12-29T11:53:56.000Z | 2019-12-29T11:53:56.000Z | odoo/addons/stock/__init__.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | null | null | null | odoo/addons/stock/__init__.py | tuanquanghpvn/odoo8-tutorial | 52d25f1ca5f233c431cb9d3b24b79c3b4fb5127e | [
"MIT"
] | 3 | 2020-10-08T14:42:10.000Z | 2022-01-28T14:12:29.000Z | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | 34.84375 | 78 | 0.627803 | true | true | |
790361faaf2d5169e7e370d3622b4df1a156470f | 1,714 | py | Python | tests/enumeration/run.py | jonnyrocks/pyangbind | 7a7c6df6ddad7cbec941800431840253b5e2f186 | [
"Apache-2.0"
] | 176 | 2015-06-17T15:44:07.000Z | 2022-03-18T01:16:19.000Z | tests/enumeration/run.py | jonnyrocks/pyangbind | 7a7c6df6ddad7cbec941800431840253b5e2f186 | [
"Apache-2.0"
] | 245 | 2015-05-29T07:04:13.000Z | 2022-03-25T14:44:37.000Z | tests/enumeration/run.py | jonnyrocks/pyangbind | 7a7c6df6ddad7cbec941800431840253b5e2f186 | [
"Apache-2.0"
] | 118 | 2015-07-02T07:04:36.000Z | 2022-03-31T20:32:38.000Z | #!/usr/bin/env python
import unittest
from tests.base import PyangBindTestCase
class EnumerationTests(PyangBindTestCase):
yang_files = ["enumeration.yang"]
def setUp(self):
self.enum_obj = self.bindings.enumeration()
def test_container_has_all_leafs(self):
for leaf in ["e", "f"]:
... | 30.070175 | 115 | 0.608518 |
import unittest
from tests.base import PyangBindTestCase
class EnumerationTests(PyangBindTestCase):
yang_files = ["enumeration.yang"]
def setUp(self):
self.enum_obj = self.bindings.enumeration()
def test_container_has_all_leafs(self):
for leaf in ["e", "f"]:
with self.subT... | true | true |
7903639ba74efdc3a98e9a3023c99764629751c1 | 968 | py | Python | flask_service/views.py | mwprog/atomist-flask-microservice | 65a18a0f149bf30af3cb5f9eb0818aa784901ade | [
"Apache-2.0"
] | null | null | null | flask_service/views.py | mwprog/atomist-flask-microservice | 65a18a0f149bf30af3cb5f9eb0818aa784901ade | [
"Apache-2.0"
] | 6 | 2018-06-06T20:00:46.000Z | 2018-06-08T14:19:55.000Z | flask_service/views.py | mwprog/atomist-flask-microservice | 65a18a0f149bf30af3cb5f9eb0818aa784901ade | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Blueprint, jsonify
from flask_service.swagger import spec
__all__ = ['main_app']
main_app = Blueprint('main_app', __name__)
@main_app.route('/api')
def swagger():
"""
Responds with the OpenAPI specification for this application.
"""
return jsonify(spec.to_d... | 24.2 | 77 | 0.677686 |
from flask import Blueprint, jsonify
from flask_service.swagger import spec
__all__ = ['main_app']
main_app = Blueprint('main_app', __name__)
@main_app.route('/api')
def swagger():
return jsonify(spec.to_dict())
@main_app.route('/health')
def health():
return ""
@main_app.route('/status')
de... | true | true |
790364466785d40ee8c57322728dd080b8ae9ad1 | 22,582 | py | Python | sgkit/io/bgen/bgen_reader.py | pystatgen/sgk | f39e1b1bc3b16d05c5043ab5d445076424dad229 | [
"Apache-2.0"
] | 74 | 2020-06-16T18:08:24.000Z | 2022-02-10T06:42:30.000Z | sgkit/io/bgen/bgen_reader.py | pystatgen/sgk | f39e1b1bc3b16d05c5043ab5d445076424dad229 | [
"Apache-2.0"
] | 677 | 2020-06-18T15:57:33.000Z | 2022-03-31T16:20:50.000Z | sgkit/io/bgen/bgen_reader.py | pystatgen/sgk | f39e1b1bc3b16d05c5043ab5d445076424dad229 | [
"Apache-2.0"
] | 20 | 2020-06-22T13:40:10.000Z | 2022-03-05T03:33:13.000Z | """BGEN reader implementation (using bgen_reader)"""
import logging
import tempfile
import time
from pathlib import Path
from typing import (
Any,
Dict,
Hashable,
List,
Mapping,
MutableMapping,
Optional,
Tuple,
Union,
)
import dask
import dask.array as da
import dask.dataframe as dd... | 36.959083 | 113 | 0.64299 | import logging
import tempfile
import time
from pathlib import Path
from typing import (
Any,
Dict,
Hashable,
List,
Mapping,
MutableMapping,
Optional,
Tuple,
Union,
)
import dask
import dask.array as da
import dask.dataframe as dd
import numpy as np
import pandas as pd
import xarray... | true | true |
790364b2b7522f5e871c2f5f6190986de71a651e | 516 | py | Python | core/migrations/0058_auto_20200421_2342.py | ArthurGorgonio/suggestclasses | 7e6ce79cca6cd92ed8a38b12707f900f019508c8 | [
"MIT"
] | null | null | null | core/migrations/0058_auto_20200421_2342.py | ArthurGorgonio/suggestclasses | 7e6ce79cca6cd92ed8a38b12707f900f019508c8 | [
"MIT"
] | null | null | null | core/migrations/0058_auto_20200421_2342.py | ArthurGorgonio/suggestclasses | 7e6ce79cca6cd92ed8a38b12707f900f019508c8 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-22 02:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0057_sugestaoturma_horarios'),
]
operations = [
migrations.RemoveField(
model_name='sugestaoturma',
name='ho... | 22.434783 | 60 | 0.585271 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0057_sugestaoturma_horarios'),
]
operations = [
migrations.RemoveField(
model_name='sugestaoturma',
name='horarios',
),
migrations.AddField... | true | true |
790365b158d207c9ebf6d939cfdb6c52a67232f5 | 681 | py | Python | setup.py | bjoekeldude/edu_python_mini_lib | 88250f145d3a97ea196f6be833bd61c102979f05 | [
"MIT"
] | null | null | null | setup.py | bjoekeldude/edu_python_mini_lib | 88250f145d3a97ea196f6be833bd61c102979f05 | [
"MIT"
] | null | null | null | setup.py | bjoekeldude/edu_python_mini_lib | 88250f145d3a97ea196f6be833bd61c102979f05 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
VERSION = '0.0.1'
DESCRIPTION = 'edu-lib'
LONG_DESCRIPTION = 'Libary zum erlernen der Grundstruktur.'
setup(
name="mylibrary",
version=VERSION,
author="Stephan Bökelmann",
author_email="sb@gruppe.ai",
scripts=[],
description... | 26.192308 | 59 | 0.581498 | from setuptools import setup, find_packages
VERSION = '0.0.1'
DESCRIPTION = 'edu-lib'
LONG_DESCRIPTION = 'Libary zum erlernen der Grundstruktur.'
setup(
name="mylibrary",
version=VERSION,
author="Stephan Bökelmann",
author_email="sb@gruppe.ai",
scripts=[],
description... | true | true |
790365ece16e164a9628b1112873cb5cd411fbaa | 162 | py | Python | tests/functional/test_tweens.py | kevinjalbert/h | 0f260bf59847f27eff720eeb3c3b2468571412b2 | [
"BSD-2-Clause"
] | 1 | 2020-06-19T01:49:39.000Z | 2020-06-19T01:49:39.000Z | tests/functional/test_tweens.py | kevinjalbert/h | 0f260bf59847f27eff720eeb3c3b2468571412b2 | [
"BSD-2-Clause"
] | 5 | 2019-10-31T14:23:18.000Z | 2019-11-15T19:24:27.000Z | tests/functional/test_tweens.py | liquidinvestigations/hypothesis-h | 2eebc0b20823fc5bc42a8e8c33551a6d448ad6ba | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
class TestInvalidPathTweenFactory:
def test_it_400s_if_the_requested_path_isnt_utf8(self, app):
app.get("/%c5", status=400)
| 23.142857 | 64 | 0.697531 |
class TestInvalidPathTweenFactory:
def test_it_400s_if_the_requested_path_isnt_utf8(self, app):
app.get("/%c5", status=400)
| true | true |
79036680f5e4af3db294cdc0dec88cb9d0ded8ce | 3,563 | py | Python | monitor.py | mvelten/office-weather | 9e6f8da90f12dcb5a947da930477ce1ffc3b163d | [
"MIT"
] | null | null | null | monitor.py | mvelten/office-weather | 9e6f8da90f12dcb5a947da930477ce1ffc3b163d | [
"MIT"
] | null | null | null | monitor.py | mvelten/office-weather | 9e6f8da90f12dcb5a947da930477ce1ffc3b163d | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
# based on code by henryk ploetz
# https://hackaday.io/project/5301-reverse-engineering-a-low-cost-usb-co-monitor/log/17909-all-your-base-are-belong-to-us
# and the wooga office weather project
# https://blog.wooga.com/woogas-office-weather-wow-67e24a5338
import os, sys, fcntl, time, socket
fr... | 30.452991 | 121 | 0.575639 |
import os, sys, fcntl, time, socket
from prometheus_client import start_http_server, Gauge, Summary, Counter
import requests
def callback_function(error, result):
if error:
print(error)
return
print(result)
def hd(d):
return " ".join("%02X" % e for e in d)
def now():
return i... | false | true |
790367d4b5a5c50d54a33a4c20347f5a8e4d547f | 4,611 | py | Python | Concordance/condordance_utils.py | erikvanmulligen/etransafe-heatmap | effba453d661f2feaa756640a730483fa41e37fc | [
"MIT"
] | null | null | null | Concordance/condordance_utils.py | erikvanmulligen/etransafe-heatmap | effba453d661f2feaa756640a730483fa41e37fc | [
"MIT"
] | 1 | 2021-02-11T14:59:37.000Z | 2021-02-11T14:59:37.000Z | Concordance/condordance_utils.py | erikvanmulligen/etransafe-heatmap | effba453d661f2feaa756640a730483fa41e37fc | [
"MIT"
] | null | null | null | import mysql.connector
import json
import os
import requests
def getAllFindings(host, database, user, password, table, where):
db = mysql.connector.connect(host=host, database=database, user=user, password=password)
cursor = db.cursor()
cursor.execute("SELECT distinct findingCode, specimenOrganCode FROM "... | 35.744186 | 149 | 0.561483 | import mysql.connector
import json
import os
import requests
def getAllFindings(host, database, user, password, table, where):
db = mysql.connector.connect(host=host, database=database, user=user, password=password)
cursor = db.cursor()
cursor.execute("SELECT distinct findingCode, specimenOrganCode FROM "... | true | true |
7903683c5afe13c10cb0b8d29c63cf46b5c93d8b | 433 | py | Python | kafka-python/ConsumerAuth.py | pengfei99/KafkaPyClient | b18b361aedec9b58eef27c1d6f97346a64a1f154 | [
"Apache-2.0"
] | null | null | null | kafka-python/ConsumerAuth.py | pengfei99/KafkaPyClient | b18b361aedec9b58eef27c1d6f97346a64a1f154 | [
"Apache-2.0"
] | null | null | null | kafka-python/ConsumerAuth.py | pengfei99/KafkaPyClient | b18b361aedec9b58eef27c1d6f97346a64a1f154 | [
"Apache-2.0"
] | null | null | null | from kafka import KafkaConsumer
KAFKA_SERVER_URL = 'localhost:9092'
LOGIN = "bob"
PWD = "bob-secret"
TOPIC = "test-topic"
GROUP_ID = 'bob-group'
consumer = KafkaConsumer(TOPIC, group_id=GROUP_ID, bootstrap_servers=KAFKA_SERVER_URL,
security_protocol="SASL_PLAINTEXT",
... | 28.866667 | 100 | 0.69746 | from kafka import KafkaConsumer
KAFKA_SERVER_URL = 'localhost:9092'
LOGIN = "bob"
PWD = "bob-secret"
TOPIC = "test-topic"
GROUP_ID = 'bob-group'
consumer = KafkaConsumer(TOPIC, group_id=GROUP_ID, bootstrap_servers=KAFKA_SERVER_URL,
security_protocol="SASL_PLAINTEXT",
... | true | true |
790369cc05bead275aea27c7f3664bac057fd5a2 | 1,220 | py | Python | conftest.py | bennylope/django-simple-auth | 4b2acbc4bb4d0a958895235ca36b9c371853bc6e | [
"BSD-2-Clause"
] | 1 | 2018-05-18T07:42:35.000Z | 2018-05-18T07:42:35.000Z | conftest.py | bennylope/django-simple-auth | 4b2acbc4bb4d0a958895235ca36b9c371853bc6e | [
"BSD-2-Clause"
] | 2 | 2017-03-16T18:02:50.000Z | 2018-01-02T17:43:18.000Z | conftest.py | bennylope/django-simple-auth | 4b2acbc4bb4d0a958895235ca36b9c371853bc6e | [
"BSD-2-Clause"
] | null | null | null | """
Configuration file for py.test
"""
import django
def pytest_configure():
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
USE_I18N=True,
ROOT_URLCONF="tests.urls",
DATABASES={
"default": {
"ENGINE": "django.d... | 27.111111 | 77 | 0.536066 |
import django
def pytest_configure():
from django.conf import settings
settings.configure(
DEBUG=True,
USE_TZ=True,
USE_I18N=True,
ROOT_URLCONF="tests.urls",
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"N... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.