hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76c2a152e58327bc5cae5145548f68c033f953c | 1,796 | py | Python | tests/test_rfc3339.py | johanvdw/Fiona | ed96d79d61762606114a2217a1ce090b16783164 | [
"BSD-3-Clause"
] | null | null | null | tests/test_rfc3339.py | johanvdw/Fiona | ed96d79d61762606114a2217a1ce090b16783164 | [
"BSD-3-Clause"
] | null | null | null | tests/test_rfc3339.py | johanvdw/Fiona | ed96d79d61762606114a2217a1ce090b16783164 | [
"BSD-3-Clause"
] | null | null | null | # testing Fiona's RFC 3339 support, to be called by nosetests
import logging
import re
import sys
import unittest
from fiona.rfc3339 import parse_date, parse_datetime, parse_time
from fiona.rfc3339 import group_accessor, pattern_date
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
class DateParseTest(un... | 28.0625 | 69 | 0.627506 |
import logging
import re
import sys
import unittest
from fiona.rfc3339 import parse_date, parse_datetime, parse_time
from fiona.rfc3339 import group_accessor, pattern_date
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
class DateParseTest(unittest.TestCase):
def test_yyyymmdd(self):
self.f... | true | true |
f76c2a878bf7d50f334167516bc3f9d8fb351801 | 2,097 | py | Python | mqtt2influxdb/cli.py | tvecera/bch-mqtt2influxdb | 6e3f6b898144ce89307e61858364d005f8f6a35d | [
"MIT"
] | 15 | 2018-01-14T16:27:11.000Z | 2020-06-08T00:44:16.000Z | mqtt2influxdb/cli.py | tvecera/bch-mqtt2influxdb | 6e3f6b898144ce89307e61858364d005f8f6a35d | [
"MIT"
] | 11 | 2018-05-03T07:42:34.000Z | 2020-06-24T10:01:22.000Z | mqtt2influxdb/cli.py | tvecera/bch-mqtt2influxdb | 6e3f6b898144ce89307e61858364d005f8f6a35d | [
"MIT"
] | 10 | 2020-08-07T11:22:24.000Z | 2022-01-13T15:54:17.000Z | #!/usr/bin/env python3
import os
import sys
import argparse
import logging
from time import sleep
from urllib3 import disable_warnings
from .config import load_config, ConfigError
from .mqtt2influxdb import Mqtt2InfluxDB
from . import __version__
LOG_FORMAT = '%(asctime)s %(levelname)s: %(message)s'
def main():
... | 31.772727 | 145 | 0.636624 |
import os
import sys
import argparse
import logging
from time import sleep
from urllib3 import disable_warnings
from .config import load_config, ConfigError
from .mqtt2influxdb import Mqtt2InfluxDB
from . import __version__
LOG_FORMAT = '%(asctime)s %(levelname)s: %(message)s'
def main():
argp = argparse.Argume... | true | true |
f76c2afa1b5c991b80abd0e45860f112d93c493a | 6,140 | py | Python | preprocessor/main.py | hellpanderrr/chicksexer | 7cf2bd1f3bea7501c7a64eda06e9d0506a061928 | [
"MIT"
] | 3 | 2018-10-26T23:55:33.000Z | 2019-03-08T09:45:29.000Z | preprocessor/main.py | hellpanderrr/chicksexer | 7cf2bd1f3bea7501c7a64eda06e9d0506a061928 | [
"MIT"
] | null | null | null | preprocessor/main.py | hellpanderrr/chicksexer | 7cf2bd1f3bea7501c7a64eda06e9d0506a061928 | [
"MIT"
] | 1 | 2019-09-10T17:44:41.000Z | 2019-09-10T17:44:41.000Z | # -*- coding: UTF-8 -*-
"""
Main module of preprocessor package. Can be executed by `python -m preprocessor`.
"""
import os
import pickle
from random import shuffle
import numpy as np
from chicksexer.constant import POSITIVE_CLASS, NEGATIVE_CLASS, NEUTRAL_CLASS, CLASS2DEFAULT_CUTOFF
from chicksexer.util import get_lo... | 36.987952 | 100 | 0.698046 | import os
import pickle
from random import shuffle
import numpy as np
from chicksexer.constant import POSITIVE_CLASS, NEGATIVE_CLASS, NEUTRAL_CLASS, CLASS2DEFAULT_CUTOFF
from chicksexer.util import get_logger
from preprocessor import PACKAGE_ROOT
from preprocessor.dbpedia import gen_triples_from_file
from preprocesso... | true | true |
f76c2b876ba40a87c8b49adaeee57d6dede43b56 | 3,851 | py | Python | examples/wav2vec2_compression_demo/wav2vec2_compression_demo.py | Rexiome/Knowledge-Distillation-Toolkit | 5e11420cb0d7e23adda17e2212b515516a53c883 | [
"MIT"
] | null | null | null | examples/wav2vec2_compression_demo/wav2vec2_compression_demo.py | Rexiome/Knowledge-Distillation-Toolkit | 5e11420cb0d7e23adda17e2212b515516a53c883 | [
"MIT"
] | null | null | null | examples/wav2vec2_compression_demo/wav2vec2_compression_demo.py | Rexiome/Knowledge-Distillation-Toolkit | 5e11420cb0d7e23adda17e2212b515516a53c883 | [
"MIT"
] | null | null | null | from collections import ChainMap
import yaml
import torch
import fairseq_mod
import sys
sys.path.append("../..")
from wav2vec2_inference_pipeline import inference_pipeline
from data_loader import LibriSpeechDataLoader
from knowledge_distillation.kd_training import KnowledgeDistillationTraining
from fairseq_mod.model... | 64.183333 | 173 | 0.633602 | from collections import ChainMap
import yaml
import torch
import fairseq_mod
import sys
sys.path.append("../..")
from wav2vec2_inference_pipeline import inference_pipeline
from data_loader import LibriSpeechDataLoader
from knowledge_distillation.kd_training import KnowledgeDistillationTraining
from fairseq_mod.model... | true | true |
f76c2c5bfa37161a32f879a0dde4186c348c1563 | 1,930 | py | Python | garb/tests/config.py | marcelogumercinocosta/django-garb | 99cdf555ab4b5eaa1aa6ac5df032835d4e2af603 | [
"MIT"
] | 17 | 2020-06-19T19:03:25.000Z | 2021-05-03T15:22:32.000Z | garb/tests/config.py | marcelogumercinocosta/django-garb | 99cdf555ab4b5eaa1aa6ac5df032835d4e2af603 | [
"MIT"
] | null | null | null | garb/tests/config.py | marcelogumercinocosta/django-garb | 99cdf555ab4b5eaa1aa6ac5df032835d4e2af603 | [
"MIT"
] | 1 | 2021-11-25T21:15:06.000Z | 2021-11-25T21:15:06.000Z | from django.contrib.admin import ModelAdmin
from django.conf import settings
from garb.config import default_config, get_config
from garb.tests.mixins import UserTestCaseMixin
from garb.tests.models import *
class ConfigTestCase(UserTestCaseMixin):
def test_garb_config_when_not_defined(self):
try:
... | 35.090909 | 89 | 0.68601 | from django.contrib.admin import ModelAdmin
from django.conf import settings
from garb.config import default_config, get_config
from garb.tests.mixins import UserTestCaseMixin
from garb.tests.models import *
class ConfigTestCase(UserTestCaseMixin):
def test_garb_config_when_not_defined(self):
try:
... | true | true |
f76c2c9d6d831671a2df7f80218828361c07e3f0 | 5,185 | py | Python | src/chaospy/distributions/copulas/baseclass.py | yoon-gu/chaospy | fe541840a79882008f38764cd7ba4935a4fd4fa3 | [
"BSD-3-Clause"
] | 1 | 2018-08-22T01:51:25.000Z | 2018-08-22T01:51:25.000Z | src/chaospy/distributions/copulas/baseclass.py | TribleCircle/chaospy | f22aa31e2a338a32a6d09b810c5b629c10a87236 | [
"BSD-3-Clause"
] | null | null | null | src/chaospy/distributions/copulas/baseclass.py | TribleCircle/chaospy | f22aa31e2a338a32a6d09b810c5b629c10a87236 | [
"BSD-3-Clause"
] | 1 | 2019-11-24T17:16:30.000Z | 2019-11-24T17:16:30.000Z | r"""
A cumulative distribution function of an independent multivariate random
variable can be made dependent through a copula as follows:
.. math::
F_{Q_0,\dots,Q_{D-1}} (q_0,\dots,q_{D-1}) =
C(F_{Q_0}(q_0), \dots, F_{Q_{D-1}}(q_{D-1}))
where :math:`C` is the copula function, and :math:`F_{Q_i}` are marginal
... | 29.460227 | 79 | 0.560463 | import numpy
from .. import Dist
class Copula(Dist):
def __init__(self, dist, trans):
Dist.__init__(self, dist=dist, trans=trans,
_advance=True, _length=len(trans))
def _cdf(self, x, graph):
dist, trans = graph.dists["dist"], graph.dists["trans"]
q = graph(graph(x, d... | true | true |
f76c2ce02f476141632ae44abe93885f09a4eb19 | 513 | py | Python | db_create.py | samcheck/PyMedia | f9504fd885d91d58078eded89b755b5e9f5696bf | [
"MIT"
] | 1 | 2019-12-08T05:25:08.000Z | 2019-12-08T05:25:08.000Z | db_create.py | samcheck/PyMedia | f9504fd885d91d58078eded89b755b5e9f5696bf | [
"MIT"
] | null | null | null | db_create.py | samcheck/PyMedia | f9504fd885d91d58078eded89b755b5e9f5696bf | [
"MIT"
] | null | null | null | #!venv/bin/python3
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
from FlaskMedia import db
import os.path
db.create_all()
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
api.create(SQLALCHEMY_MIGRATE_REPO, 'db repo')
api.version_control... | 34.2 | 73 | 0.80117 | from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
from FlaskMedia import db
import os.path
db.create_all()
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
api.create(SQLALCHEMY_MIGRATE_REPO, 'db repo')
api.version_control(SQLALCHEMY_DATABAS... | true | true |
f76c2e164ac447ca013f67ad0c8da025db414a3f | 33,734 | py | Python | sunpy/coordinates/tests/test_transformations.py | Swapnil99007/sunpy | 249619d679ee8caf19f56a2cddadbfee6d026c52 | [
"BSD-2-Clause"
] | null | null | null | sunpy/coordinates/tests/test_transformations.py | Swapnil99007/sunpy | 249619d679ee8caf19f56a2cddadbfee6d026c52 | [
"BSD-2-Clause"
] | null | null | null | sunpy/coordinates/tests/test_transformations.py | Swapnil99007/sunpy | 249619d679ee8caf19f56a2cddadbfee6d026c52 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
import pytest
import astropy
import astropy.units as u
from astropy.tests.helper import quantity_allclose, assert_quantity_allclose
from astropy.coordinates import (SkyCoord, get_body_barycentric, Angle,
ConvertError, Longitude, CartesianRepresentation,
... | 45.896599 | 100 | 0.712427 | import numpy as np
import pytest
import astropy
import astropy.units as u
from astropy.tests.helper import quantity_allclose, assert_quantity_allclose
from astropy.coordinates import (SkyCoord, get_body_barycentric, Angle,
ConvertError, Longitude, CartesianRepresentation,
... | true | true |
f76c2e4cf2812889922f4200a748d8fe85548660 | 439 | py | Python | {{cookiecutter.project_slug}}/tests/conftest.py | f213/http-client | 54cf0f39ea14d61db9d9e166387cc75e81f6f570 | [
"MIT"
] | 1 | 2021-01-29T09:19:21.000Z | 2021-01-29T09:19:21.000Z | {{cookiecutter.project_slug}}/tests/conftest.py | f213/http-client | 54cf0f39ea14d61db9d9e166387cc75e81f6f570 | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/tests/conftest.py | f213/http-client | 54cf0f39ea14d61db9d9e166387cc75e81f6f570 | [
"MIT"
] | null | null | null | import json
from os import path
import pytest
from {{cookiecutter.project_slug}} import {{cookiecutter.project_facade}}
@pytest.fixture
def client():
return {{cookiecutter.project_facade}}(token='testing')
@pytest.fixture
def read_fixture():
"""Fixture reader"""
def read_file(file_path):
with ... | 19.954545 | 76 | 0.690205 | import json
from os import path
import pytest
from {{cookiecutter.project_slug}} import {{cookiecutter.project_facade}}
@pytest.fixture
def client():
return {{cookiecutter.project_facade}}(token='testing')
@pytest.fixture
def read_fixture():
"""Fixture reader"""
def read_file(file_path):
with ... | false | true |
f76c2faaa664999ebdf1b1a05e4abaab5edb3606 | 8,530 | py | Python | proxy/common/utils.py | JerryKwan/proxy.py | 57aa628920a34a7c67925911c333c0b744ed0303 | [
"BSD-3-Clause"
] | null | null | null | proxy/common/utils.py | JerryKwan/proxy.py | 57aa628920a34a7c67925911c333c0b744ed0303 | [
"BSD-3-Clause"
] | 9 | 2021-12-10T01:22:33.000Z | 2022-03-31T18:21:07.000Z | proxy/common/utils.py | JerryKwan/proxy.py | 57aa628920a34a7c67925911c333c0b744ed0303 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... | 29.413793 | 93 | 0.627198 | import sys
import ssl
import socket
import logging
import functools
import ipaddress
import contextlib
from types import TracebackType
from typing import Optional, Dict, Any, List, Tuple, Type, Callable
from ._compat import IS_WINDOWS from .constants import HTTP_1_1, COLON, WHITESPACE, CRLF, DEFAULT_TIMEOUT, DEFAULT... | true | true |
f76c2febb4f8bc02a592b699849ca2430a6a2f81 | 2,659 | py | Python | custom_components/heatzy/pilote_v2.py | Dramloc/heatzy-home-hassistant | e21236754039e58c284a6aca07c3914ee32deabc | [
"MIT"
] | null | null | null | custom_components/heatzy/pilote_v2.py | Dramloc/heatzy-home-hassistant | e21236754039e58c284a6aca07c3914ee32deabc | [
"MIT"
] | null | null | null | custom_components/heatzy/pilote_v2.py | Dramloc/heatzy-home-hassistant | e21236754039e58c284a6aca07c3914ee32deabc | [
"MIT"
] | null | null | null | from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (HVAC_MODE_AUTO,
PRESET_AWAY,
PRESET_COMFORT, PRESET_ECO,
... | 26.858586 | 79 | 0.571267 | from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (HVAC_MODE_AUTO,
PRESET_AWAY,
PRESET_COMFORT, PRESET_ECO,
... | true | true |
f76c30640355f4b57ba4d590b2cb2c5b1f473f2c | 594 | py | Python | adam/astro_utils.py | moeyensj/adam_home | 7dbe661ed9a04e9621ec4f5c9a0a9682cc37c227 | [
"MIT"
] | 9 | 2019-05-24T06:01:18.000Z | 2020-12-12T22:05:38.000Z | adam/astro_utils.py | moeyensj/adam_home | 7dbe661ed9a04e9621ec4f5c9a0a9682cc37c227 | [
"MIT"
] | 90 | 2018-11-09T22:33:17.000Z | 2021-04-28T05:04:09.000Z | adam/astro_utils.py | moeyensj/adam_home | 7dbe661ed9a04e9621ec4f5c9a0a9682cc37c227 | [
"MIT"
] | 7 | 2019-03-22T04:41:31.000Z | 2021-03-31T23:29:33.000Z | import numpy as np
JPL_OBLIQUITY = np.deg2rad(84381.448 / 3600.0)
def icrf_to_jpl_ecliptic(x, y, z, vx, vy, vz):
return _apply_x_rotation(JPL_OBLIQUITY, x, y, z, vx, vy, vz)
def jpl_ecliptic_to_icrf(x, y, z, vx, vy, vz):
return _apply_x_rotation(-JPL_OBLIQUITY, x, y, z, vx, vy, vz)
def _apply_x_rotation(... | 27 | 65 | 0.597643 | import numpy as np
JPL_OBLIQUITY = np.deg2rad(84381.448 / 3600.0)
def icrf_to_jpl_ecliptic(x, y, z, vx, vy, vz):
return _apply_x_rotation(JPL_OBLIQUITY, x, y, z, vx, vy, vz)
def jpl_ecliptic_to_icrf(x, y, z, vx, vy, vz):
return _apply_x_rotation(-JPL_OBLIQUITY, x, y, z, vx, vy, vz)
def _apply_x_rotation(... | true | true |
f76c30c14071b54e6e83f6f91f14952bbbe2f4b5 | 774 | py | Python | learning_py/learning_py/urls.py | rafaelmauricioaraujo/apipy | b9f9b62a40d4759428fa711a1b81e2516876b09f | [
"Apache-2.0"
] | null | null | null | learning_py/learning_py/urls.py | rafaelmauricioaraujo/apipy | b9f9b62a40d4759428fa711a1b81e2516876b09f | [
"Apache-2.0"
] | null | null | null | learning_py/learning_py/urls.py | rafaelmauricioaraujo/apipy | b9f9b62a40d4759428fa711a1b81e2516876b09f | [
"Apache-2.0"
] | null | null | null | """learning_py URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 35.181818 | 78 | 0.691214 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f76c31134df632ac2d4580f5df124c588b2d698b | 477 | py | Python | algorithms/bubblesort.py | eduardagoulart/sorting | a3cc1510952b1f4198d73741e11a0fe19084af76 | [
"MIT"
] | null | null | null | algorithms/bubblesort.py | eduardagoulart/sorting | a3cc1510952b1f4198d73741e11a0fe19084af76 | [
"MIT"
] | null | null | null | algorithms/bubblesort.py | eduardagoulart/sorting | a3cc1510952b1f4198d73741e11a0fe19084af76 | [
"MIT"
] | null | null | null | def bubble_sort(lista_entrada):
for i, valor_atual in enumerate(lista_entrada):
try:
if lista_entrada[i + 1] < valor_atual:
lista_entrada[i] = lista_entrada[i + 1]
lista_entrada[i + 1] = valor_atual
bubble_sort(lista_entrada)
except IndexEr... | 29.8125 | 59 | 0.610063 | def bubble_sort(lista_entrada):
for i, valor_atual in enumerate(lista_entrada):
try:
if lista_entrada[i + 1] < valor_atual:
lista_entrada[i] = lista_entrada[i + 1]
lista_entrada[i + 1] = valor_atual
bubble_sort(lista_entrada)
except IndexEr... | true | true |
f76c32dd3666f4bed696ee6c259dabe53975e470 | 419 | py | Python | tca9548mux.py | uoe-sdp/raspberry-pi-python-example-files | 932ba00104fcab00d316246ca5081b654c4f6980 | [
"Apache-2.0"
] | null | null | null | tca9548mux.py | uoe-sdp/raspberry-pi-python-example-files | 932ba00104fcab00d316246ca5081b654c4f6980 | [
"Apache-2.0"
] | null | null | null | tca9548mux.py | uoe-sdp/raspberry-pi-python-example-files | 932ba00104fcab00d316246ca5081b654c4f6980 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import board
import busio
import adafruit_tca9548a
import adafruit_drv2605
i2c = busio.I2C(board.SCL, board.SDA)
tca = adafruit_tca9548a.TCA9548A(i2c)
drv1 = adafruit_drv2605.DRV2605(tca[0])
drv2 = adafruit_drv2605.DRV2605(tca[1])
while True:
drv1.sequence[0] = adafruit_drv2605.Effect(1... | 20.95 | 54 | 0.71599 | import board
import busio
import adafruit_tca9548a
import adafruit_drv2605
i2c = busio.I2C(board.SCL, board.SDA)
tca = adafruit_tca9548a.TCA9548A(i2c)
drv1 = adafruit_drv2605.DRV2605(tca[0])
drv2 = adafruit_drv2605.DRV2605(tca[1])
while True:
drv1.sequence[0] = adafruit_drv2605.Effect(1)
drv1.play()
... | true | true |
f76c33b361ad0c91c65fc1574420ca9b04308323 | 1,125 | py | Python | qiskit/circuit/library/templates/nct/template_nct_6a_2.py | SpinQTech/SpinQKit | 2e24826688b2b26cf7efa66fd47f0e7ef883a96c | [
"Apache-2.0"
] | 2 | 2021-12-20T05:19:44.000Z | 2021-12-20T05:21:48.000Z | qiskit/circuit/library/templates/nct/template_nct_6a_2.py | SpinQTech/SpinQKit | 2e24826688b2b26cf7efa66fd47f0e7ef883a96c | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/templates/nct/template_nct_6a_2.py | SpinQTech/SpinQKit | 2e24826688b2b26cf7efa66fd47f0e7ef883a96c | [
"Apache-2.0"
] | 1 | 2021-12-20T05:20:35.000Z | 2021-12-20T05:20:35.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or deriv... | 28.125 | 78 | 0.526222 |
from qiskit.circuit.quantumcircuit import QuantumCircuit
def template_nct_6a_2():
qc = QuantumCircuit(3)
qc.ccx(0, 1, 2)
qc.ccx(0, 2, 1)
qc.ccx(0, 1, 2)
qc.ccx(0, 2, 1)
qc.ccx(0, 1, 2)
qc.ccx(0, 2, 1)
return qc
| true | true |
f76c3446839300d2b79a803a8243873617e4e3c8 | 799 | py | Python | Lib/corpuscrawler/crawl_wuv.py | cash/corpuscrawler | 8913fe1fb2b6bfdfbf2ba01d2ce88057b3b5ba3d | [
"Apache-2.0"
] | 95 | 2019-06-13T23:34:21.000Z | 2022-03-12T05:22:49.000Z | Lib/corpuscrawler/crawl_wuv.py | sahwar/corpuscrawler | 8913fe1fb2b6bfdfbf2ba01d2ce88057b3b5ba3d | [
"Apache-2.0"
] | 31 | 2019-06-02T18:56:53.000Z | 2021-08-10T20:16:02.000Z | Lib/corpuscrawler/crawl_wuv.py | sahwar/corpuscrawler | 8913fe1fb2b6bfdfbf2ba01d2ce88057b3b5ba3d | [
"Apache-2.0"
] | 35 | 2019-06-18T08:26:24.000Z | 2022-01-11T13:59:40.000Z | # coding: utf-8
# Copyright 2017 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... | 34.73913 | 74 | 0.764706 |
from __future__ import absolute_import, print_function, unicode_literals
import re
def crawl(crawler):
out = crawler.get_output(language='wuv')
crawler.crawl_pngscriptures_org(out, language='wuv')
| true | true |
f76c3544b6de21e40b706f3976a5075c0b07334f | 740 | py | Python | python/listSetTuple.py | mir-dhaka/coding_playground | f20138e404c27e008b2902d4be2e9f9d4c25b11f | [
"Apache-2.0"
] | 2 | 2019-05-23T06:05:20.000Z | 2019-11-17T01:35:45.000Z | python/listSetTuple.py | mir-dhaka/coding_playground | f20138e404c27e008b2902d4be2e9f9d4c25b11f | [
"Apache-2.0"
] | 2 | 2020-08-29T12:29:11.000Z | 2020-08-29T12:30:14.000Z | python/listSetTuple.py | mir-dhaka/coding_playground | f20138e404c27e008b2902d4be2e9f9d4c25b11f | [
"Apache-2.0"
] | 2 | 2020-07-18T17:07:36.000Z | 2021-12-06T02:21:15.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 damian <damian@damian-work>
#
# Distributed under terms of the MIT license.
"""
Testing list, set and tuple, dict and generator
"""
if __name__ == "__main__":
lst = [value for value in range(10) if value %2 == 0]
print(ls... | 24.666667 | 71 | 0.605405 |
"""
Testing list, set and tuple, dict and generator
"""
if __name__ == "__main__":
lst = [value for value in range(10) if value %2 == 0]
print(lst)
tup = tuple(lst)
print(tup)
gen = (value for value in range(10) if value %2 == 0)
print(gen)
for item in gen:
print item
myset... | false | true |
f76c355bf30de33f5ad483b254f08e6eb1c98182 | 126 | py | Python | vericep/analysis/urls.py | SefaAkdeniz/Vericep-Graduation-Project-Backend-Django-MySQL | e8393ed9137811e5996b3b30faa4293a9aeb338a | [
"Apache-2.0"
] | null | null | null | vericep/analysis/urls.py | SefaAkdeniz/Vericep-Graduation-Project-Backend-Django-MySQL | e8393ed9137811e5996b3b30faa4293a9aeb338a | [
"Apache-2.0"
] | 3 | 2021-04-08T19:47:06.000Z | 2021-06-10T20:06:49.000Z | vericep/analysis/urls.py | SefaAkdeniz/Vericep-Graduation-Project-Backend-Django-MySQL | e8393ed9137811e5996b3b30faa4293a9aeb338a | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('create/', views.createAnalysis, name='create'),
]
| 18 | 57 | 0.706349 | from django.urls import path
from . import views
urlpatterns = [
path('create/', views.createAnalysis, name='create'),
]
| true | true |
f76c35e74a5fbe31870d1aa81d816fb7c295e57d | 4,026 | py | Python | ckanext-hdx_theme/ckanext/hdx_theme/controllers/explorer.py | datopian/hdx-ckan | 2d8871c035a18e48b53859fec522b997b500afe9 | [
"Apache-2.0"
] | 1 | 2020-03-07T02:47:15.000Z | 2020-03-07T02:47:15.000Z | ckanext-hdx_theme/ckanext/hdx_theme/controllers/explorer.py | datopian/hdx-ckan | 2d8871c035a18e48b53859fec522b997b500afe9 | [
"Apache-2.0"
] | null | null | null | ckanext-hdx_theme/ckanext/hdx_theme/controllers/explorer.py | datopian/hdx-ckan | 2d8871c035a18e48b53859fec522b997b500afe9 | [
"Apache-2.0"
] | null | null | null | import re
import logging
import ckan.lib.base as base
from ckan.common import _, c, g, request, response
# import exceptions as exceptions
import ckan.logic as logic
# import json
import pylons.configuration as configuration
# import ckanext.hdx_users.controllers.mailer as hdx_mailer
# from ckanext.hdx_theme.helpers.f... | 66 | 1,699 | 0.627919 | import re
import logging
import ckan.lib.base as base
from ckan.common import _, c, g, request, response
import ckan.logic as logic
import pylons.configuration as configuration
log = logging.getLogger(__name__)
get_action = logic.get_action
ValidationError = logic.ValidationError
def is_mobile_browser(user_agent):
... | true | true |
f76c3619a5f81459241bace575e7023eed78f612 | 2,295 | py | Python | qiskit_nature/algorithms/pes_samplers/__init__.py | davindratulsi/qiskit-nature | d5209bbfe6b83496dc2be327f65a24dcebdea9df | [
"Apache-2.0"
] | null | null | null | qiskit_nature/algorithms/pes_samplers/__init__.py | davindratulsi/qiskit-nature | d5209bbfe6b83496dc2be327f65a24dcebdea9df | [
"Apache-2.0"
] | null | null | null | qiskit_nature/algorithms/pes_samplers/__init__.py | davindratulsi/qiskit-nature | d5209bbfe6b83496dc2be327f65a24dcebdea9df | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 29.423077 | 96 | 0.722004 |
from .bopes_sampler import BOPESSampler
from .extrapolator import (Extrapolator, DifferentialExtrapolator, PCAExtrapolator,
PolynomialExtrapolator, SieveExtrapolator, WindowExtrapolator)
from .potentials import (EnergySurface1DSpline, HarmonicPotential, MorsePotential,
... | true | true |
f76c36e378f6ebeb6e2f3cd320bc6fc8ccda4ba7 | 5,027 | py | Python | setup.py | guilledk/trio | d09c21df3ffe401ee4314d869d82a886bd776e3c | [
"Apache-2.0",
"MIT"
] | null | null | null | setup.py | guilledk/trio | d09c21df3ffe401ee4314d869d82a886bd776e3c | [
"Apache-2.0",
"MIT"
] | null | null | null | setup.py | guilledk/trio | d09c21df3ffe401ee4314d869d82a886bd776e3c | [
"Apache-2.0",
"MIT"
] | null | null | null | from setuptools import setup, find_packages
exec(open("trio/_version.py", encoding="utf-8").read())
LONG_DESC = """\
.. image:: https://cdn.rawgit.com/python-trio/trio/9b0bec646a31e0d0f67b8b6ecc6939726faf3e17/logo/logo-with-background.svg
:width: 200px
:align: right
The Trio project's goal is to produce a prod... | 42.601695 | 121 | 0.702009 | from setuptools import setup, find_packages
exec(open("trio/_version.py", encoding="utf-8").read())
LONG_DESC = """\
.. image:: https://cdn.rawgit.com/python-trio/trio/9b0bec646a31e0d0f67b8b6ecc6939726faf3e17/logo/logo-with-background.svg
:width: 200px
:align: right
The Trio project's goal is to produce a prod... | true | true |
f76c370a1eec04ad4d3f83bbb980fb4355f83082 | 5,357 | py | Python | venv/lib/python3.6/site-packages/gym/envs/mujoco/humanoid_v3.py | amousist/cartpole | aec01e9c2d28eda6019fe8bb94804a78f2d7fbc0 | [
"MIT"
] | 3 | 2020-06-02T11:23:57.000Z | 2021-09-02T12:02:20.000Z | gym/envs/mujoco/humanoid_v3.py | huangjiancong1/gym_baxter | 7534d9504b4678a3b09a4e17466f54eaeaf23ccc | [
"Apache-2.0"
] | null | null | null | gym/envs/mujoco/humanoid_v3.py | huangjiancong1/gym_baxter | 7534d9504b4678a3b09a4e17466f54eaeaf23ccc | [
"Apache-2.0"
] | 1 | 2021-04-11T05:16:00.000Z | 2021-04-11T05:16:00.000Z | import numpy as np
from gym.envs.mujoco import mujoco_env
from gym import utils
DEFAULT_CAMERA_CONFIG = {
'trackbodyid': 1,
'distance': 4.0,
'lookat': np.array((0.0, 0.0, 2.0)),
'elevation': -20.0,
}
def mass_center(model, sim):
mass = np.expand_dims(model.body_mass, axis=1)
xpos = sim.data.... | 32.865031 | 103 | 0.63151 | import numpy as np
from gym.envs.mujoco import mujoco_env
from gym import utils
DEFAULT_CAMERA_CONFIG = {
'trackbodyid': 1,
'distance': 4.0,
'lookat': np.array((0.0, 0.0, 2.0)),
'elevation': -20.0,
}
def mass_center(model, sim):
mass = np.expand_dims(model.body_mass, axis=1)
xpos = sim.data.... | true | true |
f76c37ddba0476f2e70f1b36bb9a04115b855fe3 | 18,631 | py | Python | armada/tests/unit/handlers/test_manifest.py | openstack/airship-armada | 416eff4e52f72169c3ebf49a8ffca36086692b7a | [
"Apache-2.0"
] | 29 | 2018-05-21T04:34:34.000Z | 2019-05-10T12:32:46.000Z | armada/tests/unit/handlers/test_manifest.py | openstack/airship-armada | 416eff4e52f72169c3ebf49a8ffca36086692b7a | [
"Apache-2.0"
] | 1 | 2019-11-11T23:31:27.000Z | 2019-11-11T23:31:27.000Z | armada/tests/unit/handlers/test_manifest.py | airshipit/armada | 790af88d61bb3d0f0368faae22e94b4e533df92d | [
"Apache-2.0"
] | 9 | 2019-05-23T10:14:00.000Z | 2020-03-03T03:08:02.000Z | # Copyright 2017 The Armada Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 43.428904 | 78 | 0.702485 |
import copy
import os
import testtools
import yaml
from armada import exceptions
from armada.handlers import manifest
from armada.handlers import schema
from armada.utils import validate
class ManifestTestCase(testtools.TestCase):
def setUp(self):
super(ManifestTestCase, self).setUp()
examples... | true | true |
f76c37fef5753b2b9c2897b52ec32f35fae05ea1 | 8,898 | py | Python | deep_learning_modules.py | kun-woo-park/MNIST-Alphabet-Superposition-CNN-DACON | e5c50f6f28ae9cded2a65425f977e8f703b6fd89 | [
"BSD-3-Clause"
] | 6 | 2020-10-14T11:25:31.000Z | 2021-04-10T17:53:19.000Z | deep_learning_modules.py | kun-woo-park/MNIST-Alphabet-Superposition-CNN-DACON | e5c50f6f28ae9cded2a65425f977e8f703b6fd89 | [
"BSD-3-Clause"
] | null | null | null | deep_learning_modules.py | kun-woo-park/MNIST-Alphabet-Superposition-CNN-DACON | e5c50f6f28ae9cded2a65425f977e8f703b6fd89 | [
"BSD-3-Clause"
] | 5 | 2020-09-18T06:36:14.000Z | 2021-04-06T06:09:11.000Z | import os
import time
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import Dataset
class CustomDataset(Dataset): # custom dataset
def __init__(self, x_dat, y_dat):
x = x_dat
y = y_dat
self.len = x.shape[0]
y = y.astype('int')
... | 36.921162 | 101 | 0.55844 | import os
import time
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import Dataset
class CustomDataset(Dataset): def __init__(self, x_dat, y_dat):
x = x_dat
y = y_dat
self.len = x.shape[0]
y = y.astype('int')
x = x.astype('flo... | true | true |
f76c3848ccdc6e00a71b5bb9031d07716cfcd178 | 1,549 | py | Python | cli_apps/db_management/add.py | miccaldas/cli_apps | fb3604901a6dd62a40daeebf6a3b93fdae715b32 | [
"MIT"
] | null | null | null | cli_apps/db_management/add.py | miccaldas/cli_apps | fb3604901a6dd62a40daeebf6a3b93fdae715b32 | [
"MIT"
] | null | null | null | cli_apps/db_management/add.py | miccaldas/cli_apps | fb3604901a6dd62a40daeebf6a3b93fdae715b32 | [
"MIT"
] | null | null | null | """
This module will take care of any uploading to
the db, through this app.
"""
import subprocess
import click
import isort # noqa: F401
import snoop
from loguru import logger
from mysql.connector import Error, connect
fmt = "{time} - {name} - {level} - {message}"
logger.add("../logs/info.log", level="INFO", format... | 27.175439 | 103 | 0.634603 | import subprocess
import click
import isort import snoop
from loguru import logger
from mysql.connector import Error, connect
fmt = "{time} - {name} - {level} - {message}"
logger.add("../logs/info.log", level="INFO", format=fmt, backtrace=True, diagnose=True) logger.add("../logs/error.log", level="ERROR", format=fm... | true | true |
f76c396a6e4f38c4a7d7b66af45e333e6dd3f99a | 2,810 | py | Python | trinity/spec/test_spec.py | chyanju/Poe | 7602f413378c0c3a88a5edac8125fb4dcb17765b | [
"MIT"
] | null | null | null | trinity/spec/test_spec.py | chyanju/Poe | 7602f413378c0c3a88a5edac8125fb4dcb17765b | [
"MIT"
] | null | null | null | trinity/spec/test_spec.py | chyanju/Poe | 7602f413378c0c3a88a5edac8125fb4dcb17765b | [
"MIT"
] | null | null | null | import unittest
from .type import EnumType, ValueType
from .spec import TypeSpec, ProductionSpec, PredicateSpec
class TestTrinitySpec(unittest.TestCase):
def test_type(self):
ty0 = EnumType('Type0')
ty1 = ValueType('Type1')
spec = TypeSpec()
spec.define_type(ty0)
spec.defi... | 36.973684 | 77 | 0.64911 | import unittest
from .type import EnumType, ValueType
from .spec import TypeSpec, ProductionSpec, PredicateSpec
class TestTrinitySpec(unittest.TestCase):
def test_type(self):
ty0 = EnumType('Type0')
ty1 = ValueType('Type1')
spec = TypeSpec()
spec.define_type(ty0)
spec.defi... | true | true |
f76c3a650661b877800a839a5dfc8894568cab39 | 16,010 | py | Python | fp16/fp16.py | AnastasiiaNovikova/sentiment-discovery | eaae55921038d674e2f16fbd0bfd2e63194a9545 | [
"BSD-3-Clause"
] | null | null | null | fp16/fp16.py | AnastasiiaNovikova/sentiment-discovery | eaae55921038d674e2f16fbd0bfd2e63194a9545 | [
"BSD-3-Clause"
] | null | null | null | fp16/fp16.py | AnastasiiaNovikova/sentiment-discovery | eaae55921038d674e2f16fbd0bfd2e63194a9545 | [
"BSD-3-Clause"
] | 1 | 2019-03-13T11:43:13.000Z | 2019-03-13T11:43:13.000Z | import torch
from torch import nn
from torch.autograd import Variable
from torch.nn.parameter import Parameter
from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
from .loss_scaler import DynamicLossScaler, LossScaler
FLOAT_TYPES = (torch.FloatTensor, torch.cuda.FloatTensor)
HALF_TYPES ... | 46.271676 | 456 | 0.650781 | import torch
from torch import nn
from torch.autograd import Variable
from torch.nn.parameter import Parameter
from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
from .loss_scaler import DynamicLossScaler, LossScaler
FLOAT_TYPES = (torch.FloatTensor, torch.cuda.FloatTensor)
HALF_TYPES ... | true | true |
f76c3a9bbd60a35668b8a74e14cb336338506edb | 365 | py | Python | 001113StepikPyGEK/StepikPyGEK001113сh01p01st05C02_20200405.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001113StepikPyGEK/StepikPyGEK001113сh01p01st05C02_20200405.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001113StepikPyGEK/StepikPyGEK001113сh01p01st05C02_20200405.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | # Когда у Васи получилось написать его первую задачу, он решил попробовать что-нибудь своё,
# например, вывести на экран фразу Компьютер, я управляю тобой! Но что-то опять пошло не так.
# Помогите Васе дописать программу.
# Sample Input:
#
# Sample Output:
# Компьютер, я управляю тобой!
# print("Компьютер, я управляю т... | 36.5 | 93 | 0.756164 | print("Копьютер, я управляю тобой!")
| true | true |
f76c3b0b83675043a74a28642ea123ca8f494d27 | 5,594 | py | Python | tests/unit/univariate/test_base.py | ZhuofanXie/Copulas | 3210fc141c741185b781686cb69e00a96972d960 | [
"MIT"
] | 1 | 2020-11-30T06:56:14.000Z | 2020-11-30T06:56:14.000Z | tests/unit/univariate/test_base.py | ZhuofanXie/Copulas | 3210fc141c741185b781686cb69e00a96972d960 | [
"MIT"
] | null | null | null | tests/unit/univariate/test_base.py | ZhuofanXie/Copulas | 3210fc141c741185b781686cb69e00a96972d960 | [
"MIT"
] | null | null | null | from unittest import TestCase
import numpy as np
from copulas.univariate.base import BoundedType, ParametricType, Univariate
from copulas.univariate.beta import BetaUnivariate
from copulas.univariate.gamma import GammaUnivariate
from copulas.univariate.gaussian import GaussianUnivariate
from copulas.univariate.gaussi... | 28.687179 | 92 | 0.634072 | from unittest import TestCase
import numpy as np
from copulas.univariate.base import BoundedType, ParametricType, Univariate
from copulas.univariate.beta import BetaUnivariate
from copulas.univariate.gamma import GammaUnivariate
from copulas.univariate.gaussian import GaussianUnivariate
from copulas.univariate.gaussi... | true | true |
f76c3b1441b5a0d9cc5d43aecb52a609285f6c56 | 6,680 | py | Python | src/game.py | t-keazirian/tic-tac-toe | df557aaa6f01e3bfaf68dea96f9994bc3815067b | [
"MIT"
] | null | null | null | src/game.py | t-keazirian/tic-tac-toe | df557aaa6f01e3bfaf68dea96f9994bc3815067b | [
"MIT"
] | 5 | 2022-03-18T19:07:56.000Z | 2022-03-25T17:00:50.000Z | src/game.py | t-keazirian/tic-tac-toe | df557aaa6f01e3bfaf68dea96f9994bc3815067b | [
"MIT"
] | null | null | null | import random
from src.board import Board
from src.human_player import HumanPlayer
from src.message import Message
from src.rules import Rules
from src.spanish_message import SpanishMessage
from src.user_interface import UserInterface
from src.validator import Validator
from src.symbol import SymbolOptions
from src.con... | 38.612717 | 85 | 0.663623 | import random
from src.board import Board
from src.human_player import HumanPlayer
from src.message import Message
from src.rules import Rules
from src.spanish_message import SpanishMessage
from src.user_interface import UserInterface
from src.validator import Validator
from src.symbol import SymbolOptions
from src.con... | true | true |
f76c3b41c917cc5582d44689e6c1a9722c081f99 | 904 | py | Python | protests/migrations/0002_auto_20200925_1922.py | mentix02/revolve | 59e3c2999bb511515478e20edf80556665de6c67 | [
"MIT"
] | null | null | null | protests/migrations/0002_auto_20200925_1922.py | mentix02/revolve | 59e3c2999bb511515478e20edf80556665de6c67 | [
"MIT"
] | null | null | null | protests/migrations/0002_auto_20200925_1922.py | mentix02/revolve | 59e3c2999bb511515478e20edf80556665de6c67 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-25 13:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('prot... | 26.588235 | 84 | 0.591814 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('protests', '0001_initial'),
]
operations = ... | true | true |
f76c3bd958081070939a85c390eeaeaa389ad5a4 | 11,757 | py | Python | python/paddle/fluid/tests/unittests/test_imperative_deepcf.py | Sand3r-/Paddle | 1217a521554d63caa1381b8716910d0268dfc22d | [
"Apache-2.0"
] | 3 | 2021-06-11T06:48:10.000Z | 2021-09-02T10:18:06.000Z | python/paddle/fluid/tests/unittests/test_imperative_deepcf.py | Sand3r-/Paddle | 1217a521554d63caa1381b8716910d0268dfc22d | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_imperative_deepcf.py | Sand3r-/Paddle | 1217a521554d63caa1381b8716910d0268dfc22d | [
"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 appli... | 38.547541 | 80 | 0.563834 |
import unittest
import numpy as np
import random
import os
import sys
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from test_imperative_base import new_program_scope
from paddle.fluid.dygraph.base import to_variable
from paddle.fluid.dygraph import Linear
DATA_PATH = os.environ.get('DA... | true | true |
f76c3c6d4451fb63a0ba3907598791e0222afcc8 | 2,938 | py | Python | tools/publish_tool.py | HaoXuan40404/opendp | 49c82179f36415d20533c6712f49e518d34b9447 | [
"MIT"
] | 95 | 2021-02-17T19:50:28.000Z | 2022-03-31T16:50:59.000Z | tools/publish_tool.py | HaoXuan40404/opendp | 49c82179f36415d20533c6712f49e518d34b9447 | [
"MIT"
] | 299 | 2021-02-10T00:14:41.000Z | 2022-03-31T16:17:33.000Z | tools/publish_tool.py | HaoXuan40404/opendp | 49c82179f36415d20533c6712f49e518d34b9447 | [
"MIT"
] | 13 | 2021-04-01T14:40:56.000Z | 2022-03-27T08:52:46.000Z | import argparse
import os
import subprocess
import sys
def log(message, command=False):
prefix = "$" if command else "#"
print(f"{prefix} {message}", file=sys.stderr)
def run_command(description, args, capture_output=True, shell=True):
if description:
log(description)
printed_args = args.joi... | 37.189873 | 131 | 0.696052 | import argparse
import os
import subprocess
import sys
def log(message, command=False):
prefix = "$" if command else "#"
print(f"{prefix} {message}", file=sys.stderr)
def run_command(description, args, capture_output=True, shell=True):
if description:
log(description)
printed_args = args.joi... | true | true |
f76c3cb553ec4516c7cba98c38660dcc610283b7 | 294 | py | Python | hallonalmanackan/models.py | boxed/hallonalmanackan | 1289ff533e0af894cd9defc81a931b317d1fab28 | [
"BSD-3-Clause"
] | null | null | null | hallonalmanackan/models.py | boxed/hallonalmanackan | 1289ff533e0af894cd9defc81a931b317d1fab28 | [
"BSD-3-Clause"
] | null | null | null | hallonalmanackan/models.py | boxed/hallonalmanackan | 1289ff533e0af894cd9defc81a931b317d1fab28 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
class Holiday(models.Model):
year = models.IntegerField(db_index=True)
month = models.SmallIntegerField()
day = models.SmallIntegerField()
name = models.CharField(max_length=255)
class Meta:
unique_together = ('year', 'month', 'day')
| 24.5 | 50 | 0.690476 | from django.db import models
class Holiday(models.Model):
year = models.IntegerField(db_index=True)
month = models.SmallIntegerField()
day = models.SmallIntegerField()
name = models.CharField(max_length=255)
class Meta:
unique_together = ('year', 'month', 'day')
| true | true |
f76c3cc44efabe24f2c3146bf2a73147835ea8f8 | 840 | py | Python | thetae/schemas/__init__.py | jweyn/theta-e | 7f4262ea0925a6069a5df67eb42b4d14f18ba450 | [
"MIT"
] | 2 | 2020-05-05T04:47:15.000Z | 2022-01-16T20:02:37.000Z | thetae/schemas/__init__.py | jweyn/theta-e | 7f4262ea0925a6069a5df67eb42b4d14f18ba450 | [
"MIT"
] | 10 | 2018-02-13T18:41:35.000Z | 2020-05-04T22:24:37.000Z | thetae/schemas/__init__.py | jweyn/theta-e | 7f4262ea0925a6069a5df67eb42b4d14f18ba450 | [
"MIT"
] | 2 | 2019-05-03T06:04:11.000Z | 2019-10-22T20:30:40.000Z | #
# Copyright (c) 2017 Jonathan Weyn <jweyn@uw.edu>
#
# See the file LICENSE for your rights.
#
"""
Module containing database schemas. Please see the default.py schema for
example database structures.
"""
# =============================================================================
# It may no longer be necessary ... | 31.111111 | 89 | 0.520238 | true | true | |
f76c3db45dc500cb699133c52b378909b69d67b3 | 381 | py | Python | perftracker/migrations/0035_auto_20180930_2224.py | istillc0de/perftracker-perfguru | 79d0f1740f4072503ba1bf06b871590de6bcf470 | [
"Apache-2.0"
] | 11 | 2018-03-12T05:40:02.000Z | 2020-01-30T10:13:36.000Z | perftracker/migrations/0035_auto_20180930_2224.py | istillc0de/perftracker-perfguru | 79d0f1740f4072503ba1bf06b871590de6bcf470 | [
"Apache-2.0"
] | 4 | 2019-05-12T18:38:22.000Z | 2020-07-20T07:13:34.000Z | perftracker/migrations/0035_auto_20180930_2224.py | istillc0de/perftracker-perfguru | 79d0f1740f4072503ba1bf06b871590de6bcf470 | [
"Apache-2.0"
] | 25 | 2018-07-19T12:12:09.000Z | 2022-02-15T09:16:31.000Z | # Generated by Django 2.0.3 on 2018-09-30 19:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('perftracker', '0034_auto_20180930_1813'),
]
operations = [
migrations.RenameField(
model_name='artifactmetamodel',
old_name=... | 20.052632 | 51 | 0.603675 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('perftracker', '0034_auto_20180930_1813'),
]
operations = [
migrations.RenameField(
model_name='artifactmetamodel',
old_name='gc_dt',
new_name='expires_dt',
... | true | true |
f76c3e92c73c1f2b41d277b524813d1cffb424a2 | 272 | py | Python | astroquery/ned/__init__.py | mfisherlevine/astroquery | cda88ef18b308563e86ee79bcc78e4ac59874df1 | [
"BSD-3-Clause"
] | 577 | 2015-02-12T18:23:49.000Z | 2022-03-22T21:38:58.000Z | astroquery/ned/__init__.py | mfisherlevine/astroquery | cda88ef18b308563e86ee79bcc78e4ac59874df1 | [
"BSD-3-Clause"
] | 1,812 | 2015-01-01T08:02:20.000Z | 2022-03-31T13:03:52.000Z | astroquery/ned/__init__.py | mfisherlevine/astroquery | cda88ef18b308563e86ee79bcc78e4ac59874df1 | [
"BSD-3-Clause"
] | 322 | 2015-02-23T19:31:29.000Z | 2022-03-25T18:51:30.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
warnings.warn("the ``ned`` module has been moved to astroquery.ipac.ned, "
"please update your imports.", DeprecationWarning, stacklevel=2)
from astroquery.ipac.ned import *
| 27.2 | 78 | 0.724265 |
import warnings
warnings.warn("the ``ned`` module has been moved to astroquery.ipac.ned, "
"please update your imports.", DeprecationWarning, stacklevel=2)
from astroquery.ipac.ned import *
| true | true |
f76c3ed2d3e4f9a3fa848a526cff1c907c9960c2 | 6,626 | py | Python | preprocess_raw_review.py | kenchan0226/dual_view_review_summarize | 2ff1c7323b98f0a8ca1dfb0341806e05b87faf52 | [
"MIT"
] | 18 | 2020-05-25T06:03:00.000Z | 2021-12-27T17:29:47.000Z | preprocess_raw_review.py | kenchan0226/dual_view_review_summarize | 2ff1c7323b98f0a8ca1dfb0341806e05b87faf52 | [
"MIT"
] | 3 | 2020-06-05T15:33:19.000Z | 2021-12-14T12:00:56.000Z | preprocess_raw_review.py | kenchan0226/dual_view_review_summarize | 2ff1c7323b98f0a8ca1dfb0341806e05b87faf52 | [
"MIT"
] | 4 | 2020-08-05T08:48:06.000Z | 2021-03-15T14:49:06.000Z | """Split into train, val, test. Append period to summary. Filter out too short summary and review. Build vocab"""
from os.path import join
import json
import os
import random
import argparse
from collections import Counter
import pickle as pkl
END_TOKENS = ['.', '!', '?', '...', "'", "`", '"', ")"]
#MIN_SUM_LEN = 6
#... | 40.901235 | 139 | 0.613794 |
from os.path import join
import json
import os
import random
import argparse
from collections import Counter
import pickle as pkl
END_TOKENS = ['.', '!', '?', '...', "'", "`", '"', ")"]
#MIN_SUM_LEN = 6
#MIN_REVIEW_LEN = 21
MAX_REVIEW_LEN = 800
def fix_missing_period(line):
if line == "":
return line
... | true | true |
f76c40da4970085bb365593c5b5e8fcf1cac542d | 4,603 | py | Python | pytests/plasma/plasma_stats.py | ashwin2002/TAF | 4223787a1f4c0fe9fa841543020b48ada9ade9e3 | [
"Apache-2.0"
] | null | null | null | pytests/plasma/plasma_stats.py | ashwin2002/TAF | 4223787a1f4c0fe9fa841543020b48ada9ade9e3 | [
"Apache-2.0"
] | null | null | null | pytests/plasma/plasma_stats.py | ashwin2002/TAF | 4223787a1f4c0fe9fa841543020b48ada9ade9e3 | [
"Apache-2.0"
] | null | null | null | from basetestcase import BaseTestCase
from membase.api.rest_client import RestConnection
from gsiLib.gsiHelper import GsiHelper
from plasma.plasma_base import PlasmaBaseTest
class PlasmaStatsTest(PlasmaBaseTest):
def setUp(self):
super(PlasmaStatsTest, self).setUp()
def tearDown(self):
super(... | 54.152941 | 131 | 0.502716 | from basetestcase import BaseTestCase
from membase.api.rest_client import RestConnection
from gsiLib.gsiHelper import GsiHelper
from plasma.plasma_base import PlasmaBaseTest
class PlasmaStatsTest(PlasmaBaseTest):
def setUp(self):
super(PlasmaStatsTest, self).setUp()
def tearDown(self):
super(... | true | true |
f76c40f5ea28913c15da3491f48a47de925f50fe | 11,212 | py | Python | src/python/grpcio_tests/commands.py | dpimagine/grpc | 29074664fa1fc36cad61826c830b97bfd103e376 | [
"Apache-2.0"
] | 1 | 2020-07-25T17:44:59.000Z | 2020-07-25T17:44:59.000Z | src/python/grpcio_tests/commands.py | dpimagine/grpc | 29074664fa1fc36cad61826c830b97bfd103e376 | [
"Apache-2.0"
] | null | null | null | src/python/grpcio_tests/commands.py | dpimagine/grpc | 29074664fa1fc36cad61826c830b97bfd103e376 | [
"Apache-2.0"
] | 1 | 2019-12-02T03:40:10.000Z | 2019-12-02T03:40:10.000Z | # Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 37.750842 | 115 | 0.690243 |
from distutils import errors as _errors
import glob
import os
import os.path
import platform
import re
import shutil
import sys
import setuptools
from setuptools.command import build_ext
from setuptools.command import build_py
from setuptools.command import easy_install
from setuptools.command import install
from set... | true | true |
f76c413768672def3906bb7e6558fd49f3acaf18 | 33,261 | py | Python | mne/io/brainvision/brainvision.py | christian-oreilly/mne-python | d925082e5b1e6f0f3649d8b909340e7b79a632ec | [
"BSD-3-Clause"
] | null | null | null | mne/io/brainvision/brainvision.py | christian-oreilly/mne-python | d925082e5b1e6f0f3649d8b909340e7b79a632ec | [
"BSD-3-Clause"
] | 1 | 2020-10-29T19:53:46.000Z | 2020-10-29T19:53:46.000Z | mne/io/brainvision/brainvision.py | Sinaxist/mne-python | 33146156f2660f122ecc04fa0d5b3fd3c34b549e | [
"BSD-3-Clause"
] | 1 | 2017-12-05T05:13:56.000Z | 2017-12-05T05:13:56.000Z | # -*- coding: utf-8 -*-
"""Conversion tool from Brain Vision EEG to FIF."""
# Authors: Teon Brooks <teon.brooks@gmail.com>
# Christian Brodbeck <christianbrodbeck@nyu.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Jona Sassenhagen <jona.sassenhagen@gmail.com>
# Phillip Alday <philli... | 42.370701 | 79 | 0.580229 |
import os
import re
import time
import numpy as np
from ...utils import verbose, logger, warn
from ..constants import FIFF
from ..meas_info import _empty_info
from ..base import BaseRaw, _check_update_montage
from ..utils import (_read_segments_file, _synthesize_stim_channel,
_mult_cal_one)
fr... | true | true |
f76c41a54653e490d4e7d12cc84b28542c2c3a0e | 5,971 | py | Python | app.py | Myunghee13/DSCI560_HW5 | 1a6104569b95ccca392ba67794e03054dd696c59 | [
"CC0-1.0"
] | null | null | null | app.py | Myunghee13/DSCI560_HW5 | 1a6104569b95ccca392ba67794e03054dd696c59 | [
"CC0-1.0"
] | null | null | null | app.py | Myunghee13/DSCI560_HW5 | 1a6104569b95ccca392ba67794e03054dd696c59 | [
"CC0-1.0"
] | null | null | null | import pandas as pd
import numpy as np
from bokeh.plotting import figure, show, output_notebook,ColumnDataSource,curdoc
from bokeh.models import HoverTool, Select, Div
from bokeh.layouts import row, column
from bokeh.transform import dodge
data1 = pd.read_csv('latimes-state-totals.csv')
data1['date_time']=pd.to_datet... | 39.806667 | 199 | 0.666388 | import pandas as pd
import numpy as np
from bokeh.plotting import figure, show, output_notebook,ColumnDataSource,curdoc
from bokeh.models import HoverTool, Select, Div
from bokeh.layouts import row, column
from bokeh.transform import dodge
data1 = pd.read_csv('latimes-state-totals.csv')
data1['date_time']=pd.to_datet... | true | true |
f76c41e67a37c02fd5e575857ef694d2b1a5c33c | 2,208 | py | Python | api/api/mutations/types/AuthTypes.py | VidroX/Safegistics | b177885d859f7b3524476ba6dd50bab41e6f0be6 | [
"Apache-2.0"
] | null | null | null | api/api/mutations/types/AuthTypes.py | VidroX/Safegistics | b177885d859f7b3524476ba6dd50bab41e6f0be6 | [
"Apache-2.0"
] | null | null | null | api/api/mutations/types/AuthTypes.py | VidroX/Safegistics | b177885d859f7b3524476ba6dd50bab41e6f0be6 | [
"Apache-2.0"
] | null | null | null | import graphene
from database.models.DeviceModel import DeviceModel
from database.models.DriverModel import DriverModel
from database.models.UserModel import UserModel
USER_TYPES = ['user', 'driver']
DEVICE_TYPES = ['device']
def get_type_by_obj(obj):
if isinstance(obj, UserModel):
return USER_TYPES[0]
... | 32.470588 | 62 | 0.756341 | import graphene
from database.models.DeviceModel import DeviceModel
from database.models.DriverModel import DriverModel
from database.models.UserModel import UserModel
USER_TYPES = ['user', 'driver']
DEVICE_TYPES = ['device']
def get_type_by_obj(obj):
if isinstance(obj, UserModel):
return USER_TYPES[0]
... | true | true |
f76c4356f2bdc118ef83fcdcc144d14965861c6a | 1,637 | py | Python | astropy/nddata/flag_collection.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | astropy/nddata/flag_collection.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | astropy/nddata/flag_collection.py | xiaomi1122/astropy | 8876e902f5efa02a3fc27d82fe15c16001d4df5e | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from ..utils.compat.odict import OrderedDict
from ..utils.misc import isiterable
__all__ = ['FlagCollection']
class FlagCollection(OrderedDict):
... | 35.586957 | 123 | 0.672572 |
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from ..utils.compat.odict import OrderedDict
from ..utils.misc import isiterable
__all__ = ['FlagCollection']
class FlagCollection(OrderedDict):
def __init__(self, *args, **kwargs):
if 'shape' in kw... | true | true |
f76c435bacb7752daa8425ce6ac55a655414ab2e | 528 | py | Python | Backupfile/downloadfile.py | stayukit/PythonBootcamp2021 | 523fec04bd62c607f38f9e5691228d183da1ea3f | [
"MIT"
] | null | null | null | Backupfile/downloadfile.py | stayukit/PythonBootcamp2021 | 523fec04bd62c607f38f9e5691228d183da1ea3f | [
"MIT"
] | null | null | null | Backupfile/downloadfile.py | stayukit/PythonBootcamp2021 | 523fec04bd62c607f38f9e5691228d183da1ea3f | [
"MIT"
] | null | null | null | import ftplib
import os
SERVER = 'uncle-**.com'
PORT = 2002
USER = 'test@uncle-**.com'
PASSWORD = ""
ftp = ftplib.FTP()
ftp.connect(SERVER,PORT)
ftp.login(USER,PASSWORD)
mypath = '/testcopyfile/stayu'
ftp.cwd(mypath) # accessed to mypath
path = r'C:\FTP_Work\Download'
allfile = os.listdir(path)
filename = 'test.t... | 18.857143 | 79 | 0.700758 | import ftplib
import os
SERVER = 'uncle-**.com'
PORT = 2002
USER = 'test@uncle-**.com'
PASSWORD = ""
ftp = ftplib.FTP()
ftp.connect(SERVER,PORT)
ftp.login(USER,PASSWORD)
mypath = '/testcopyfile/stayu'
ftp.cwd(mypath)
path = r'C:\FTP_Work\Download'
allfile = os.listdir(path)
filename = 'test.txt'
topathfile = os.p... | true | true |
f76c4398c22868754722b1040e9359ef9fbd49e9 | 1,871 | py | Python | hs_core/tests/api/rest/test_custom_scimeta.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_core/tests/api/rest/test_custom_scimeta.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_core/tests/api/rest/test_custom_scimeta.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | from rest_framework import status
from hs_core.hydroshare import resource
from .base import HSRESTTestCase
class TestCustomScimetaEndpoint(HSRESTTestCase):
def setUp(self):
super(TestCustomScimetaEndpoint, self).setUp()
self.rtype = 'GenericResource'
self.title = 'My Test resource'
... | 35.980769 | 90 | 0.644041 | from rest_framework import status
from hs_core.hydroshare import resource
from .base import HSRESTTestCase
class TestCustomScimetaEndpoint(HSRESTTestCase):
def setUp(self):
super(TestCustomScimetaEndpoint, self).setUp()
self.rtype = 'GenericResource'
self.title = 'My Test resource'
... | true | true |
f76c442b8b2e3dcd505597165ae4d234a4e62306 | 5,715 | py | Python | lib/matrix.py | drzix/reduce-row-echelon-form | 8005f9e137240ed03b8a46c3ae951f2a725fc4c2 | [
"MIT"
] | 1 | 2017-10-03T03:12:41.000Z | 2017-10-03T03:12:41.000Z | lib/matrix.py | drzix/reduce-row-echelon-form | 8005f9e137240ed03b8a46c3ae951f2a725fc4c2 | [
"MIT"
] | null | null | null | lib/matrix.py | drzix/reduce-row-echelon-form | 8005f9e137240ed03b8a46c3ae951f2a725fc4c2 | [
"MIT"
] | null | null | null | from fractions import Fraction
class SquareMatrix:
"""정방행렬을 나타내는 클래스."""
def __init__(self, rows):
"""정방행렬 클래스의 initiator.
행렬의 원소를 세팅해준다.
:param rows: 행렬의 각각의 원소인 integer 혹은 Fraction들로 구성된
행렬의 각각의 행인 tuple이나 list들로 구성된
tuple이나 list가 들어와야 한다.
... | 37.11039 | 107 | 0.56028 | from fractions import Fraction
class SquareMatrix:
def __init__(self, rows):
if type(rows) is not list and type(rows) is not tuple:
raise Exception('matrix param must be list or tuple')
self.rows = []
self.nr_column = None
self.nr_max_width = None
for r in ro... | true | true |
f76c459d43a1e86fcefa0879642c5d0c26382a55 | 1,271 | py | Python | tokenize/tokenize.py | khoauit99/open-NMT-test | ece4d485b04e79d4f2679b7d96720195bb1b292f | [
"MIT"
] | 1 | 2021-08-12T04:12:34.000Z | 2021-08-12T04:12:34.000Z | tokenize/tokenize.py | khoauit99/open-NMT-test | ece4d485b04e79d4f2679b7d96720195bb1b292f | [
"MIT"
] | null | null | null | tokenize/tokenize.py | khoauit99/open-NMT-test | ece4d485b04e79d4f2679b7d96720195bb1b292f | [
"MIT"
] | null | null | null | import sentencepiece as spm
s = spm.SentencePieceProcessor('data/jpa_wiki_100000.model')
#file1 = open('jyp_train.txt', 'r')
#Lines = file1.readlines()
# for i in Lines:
# print(i)
path_input_eng = 'data/eng.txt'
path_output_eng = 'data/eng_train_1000.txt'
path_input_jyp = 'data/jyp.txt'
path_output_jyp = 'da... | 28.886364 | 99 | 0.675846 | import sentencepiece as spm
s = spm.SentencePieceProcessor('data/jpa_wiki_100000.model')
path_input_eng = 'data/eng.txt'
path_output_eng = 'data/eng_train_1000.txt'
path_input_jyp = 'data/jyp.txt'
path_output_jyp = 'data/jyp_train_1000.txt'
def tokenize(sequence):
test = s.Encode(sequence, out_type= str , en... | true | true |
f76c4630238e9855d41fc617f81d46da5c5efbe0 | 5,999 | py | Python | mcculw-master/structure-tester/tests_and_examples/embeded_gui_example.py | Tridentflayer/structure_tester_project | 0c67e450f3c1cd29dd9385ce407cc1407d9b9251 | [
"MIT"
] | null | null | null | mcculw-master/structure-tester/tests_and_examples/embeded_gui_example.py | Tridentflayer/structure_tester_project | 0c67e450f3c1cd29dd9385ce407cc1407d9b9251 | [
"MIT"
] | null | null | null | mcculw-master/structure-tester/tests_and_examples/embeded_gui_example.py | Tridentflayer/structure_tester_project | 0c67e450f3c1cd29dd9385ce407cc1407d9b9251 | [
"MIT"
] | null | null | null | ###################################################################
# #
# PLOT A LIVE GRAPH (PyQt5) #
# ----------------------------- #
# EMBED A MATPLOTLIB ANIMATION INSIDE... | 32.781421 | 146 | 0.561427 |
import sys
import os
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import functools
import numpy as np
import random as rd
import matplotlib
matplotlib.use("Qt5Agg")
from matplotlib.figure import Figure
from matplotlib.animation import TimedAnimation
from matplotlib.lines import Li... | true | true |
f76c465d19f6aa66e746830447504e8e293fd043 | 1,313 | py | Python | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716222950.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716222950.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716222950.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Decorator Parametors
In the previous ideos we saw some built-in decorators that can handle some arguments:
@wraps(fn) @lru_cache(maxsize=256) <\
def inner(): def factorial(n): \
... ... \>function call
This should loo... | 25.745098 | 89 | 0.567403 | """ Decorator Parametors
In the previous ideos we saw some built-in decorators that can handle some arguments:
@wraps(fn) @lru_cache(maxsize=256) <\
def inner(): def factorial(n): \
... ... \>function call
This should loo... | false | true |
f76c471ca99f9342435ae01def537f7c480334fb | 188 | py | Python | tests/apps/foobwp/config/settings.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | tests/apps/foobwp/config/settings.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | tests/apps/foobwp/config/settings.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | from blazeweb.config import ComponentSettings
class Settings(ComponentSettings):
def init(self):
self.add_route('/foo', 'foo:UserUpdate')
self.for_me.fooattr = True
| 20.888889 | 48 | 0.702128 | from blazeweb.config import ComponentSettings
class Settings(ComponentSettings):
def init(self):
self.add_route('/foo', 'foo:UserUpdate')
self.for_me.fooattr = True
| true | true |
f76c4780444d34f5926205756bcfddbb151810bc | 2,692 | py | Python | quickstart.py | sejaldua/digesting-the-digest | 3dcb701d6d97dced63b7639218f9bc33f08ad98b | [
"MIT"
] | 8 | 2021-08-20T20:12:49.000Z | 2022-03-11T13:13:01.000Z | quickstart.py | sejaldua/digesting-the-digest | 3dcb701d6d97dced63b7639218f9bc33f08ad98b | [
"MIT"
] | 7 | 2021-10-03T02:59:46.000Z | 2022-01-07T19:37:36.000Z | quickstart.py | sejaldua/digesting-the-digest | 3dcb701d6d97dced63b7639218f9bc33f08ad98b | [
"MIT"
] | 3 | 2021-12-11T15:05:43.000Z | 2022-02-27T23:11:37.000Z | from __future__ import print_function
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
# If modifying these scopes, delete the file token.json.
SCOPES = ... | 39.014493 | 132 | 0.67682 | from __future__ import print_function
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
SCOPES = ['https://www.googleapis.com/auth/gmail.readonly']
def g... | true | true |
f76c47cfdefc8e2a39e06081b925c1e1dbd7a039 | 4,133 | py | Python | tests/test_shaker.py | getpova/treeshake | bc5087c002c075ef24277c5801390cefefeb3086 | [
"MIT"
] | 2 | 2021-04-28T20:29:31.000Z | 2021-04-29T13:34:30.000Z | tests/test_shaker.py | jackmanapp/treeshake | bc5087c002c075ef24277c5801390cefefeb3086 | [
"MIT"
] | 12 | 2021-04-28T20:15:59.000Z | 2021-06-12T13:01:11.000Z | tests/test_shaker.py | jackmanapp/treeshake | bc5087c002c075ef24277c5801390cefefeb3086 | [
"MIT"
] | null | null | null | import pytest
import os
import shutil
from treeshake import Shaker
def test_add_stylesheet_exists():
shaker = Shaker()
file = './tests/_data/css/stylesheet.css'
shaker.add_stylesheet(file)
added_sheets = shaker.get_private_attributes().get('stylesheets', set())
assert len(added_sheets) == 1
as... | 37.234234 | 111 | 0.687636 | import pytest
import os
import shutil
from treeshake import Shaker
def test_add_stylesheet_exists():
shaker = Shaker()
file = './tests/_data/css/stylesheet.css'
shaker.add_stylesheet(file)
added_sheets = shaker.get_private_attributes().get('stylesheets', set())
assert len(added_sheets) == 1
as... | true | true |
f76c486093c61239ff88522c3249bc095a82fced | 253 | py | Python | manage.py | mrbaboon/swampytodo | 096c39a57db0d8640e03262550dd1ed07191ecde | [
"MIT"
] | null | null | null | manage.py | mrbaboon/swampytodo | 096c39a57db0d8640e03262550dd1ed07191ecde | [
"MIT"
] | 2 | 2015-04-23T00:21:01.000Z | 2015-04-23T00:29:23.000Z | manage.py | mrbaboon/swampytodo | 096c39a57db0d8640e03262550dd1ed07191ecde | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "swampytodo.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23 | 74 | 0.774704 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "swampytodo.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
f76c48a5ecd0ea7e14ee89c65a6ce430d12ac4e4 | 3,231 | py | Python | build-dll.py | BigBadaboom/skia4j | 477835eae90551603029254e4835fbe70da1aeff | [
"Apache-2.0"
] | 2 | 2020-08-15T07:41:02.000Z | 2022-03-14T07:25:41.000Z | build-dll.py | BigBadaboom/skia4j | 477835eae90551603029254e4835fbe70da1aeff | [
"Apache-2.0"
] | null | null | null | build-dll.py | BigBadaboom/skia4j | 477835eae90551603029254e4835fbe70da1aeff | [
"Apache-2.0"
] | 1 | 2022-03-20T10:40:21.000Z | 2022-03-20T10:40:21.000Z | # Build a version of the site with compressed javascript and css files
import sys, os, re, shutil, glob, tempfile
#********************************************************************************************************
# Run this script from a Visual Studio command prompt
# Start -> All Programs -> Visual Studio 20... | 35.9 | 186 | 0.653049 |
import sys, os, re, shutil, glob, tempfile
CC_LINKER = "cl"
CC_LINKER_FLAGS = "/LD /DLL"
JAVA_H_DEST_DIR = os.path.join("native","src","include")
JNI_H_FILE_DIR = os.path.join(os.environ['JAVA_HOME'], "include")
JNI_H_FILE_ARCH_DIR = os.path.join(os.environ['JAVA_HOME'], "include", "win32")
SKIA_HEADERS_CONFIG_D... | true | true |
f76c48aa986d299e2224c06f73f690698133ed63 | 27,915 | py | Python | sandbox/lib/pythonbin/test/test_pysodium.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | null | null | null | sandbox/lib/pythonbin/test/test_pysodium.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | 1 | 2018-04-04T12:13:40.000Z | 2018-05-03T07:57:52.000Z | sandbox/lib/pythonbin/test/test_pysodium.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
"""
Wrapper for libsodium library
Copyright (c) 2013-2014, Marsiske Stefan.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the a... | 56.969388 | 561 | 0.7554 |
import pysodium
import unittest
import binascii
class TestPySodium(unittest.TestCase):
def test_crypto_stream(self):
pysodium.crypto_stream(8)
pysodium.crypto_stream(16)
pysodium.crypto_stream(32)
def test_crypto_stream_xor(self):
nonce = b'\x00' * pysodium.crypto_stream_NONC... | true | true |
f76c49194c80cd0266a243f74b43a3c4f6b37d0f | 27,522 | py | Python | aries_cloudagent/core/tests/test_conductor.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/core/tests/test_conductor.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/core/tests/test_conductor.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | null | null | null | import asyncio
from io import StringIO
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from ...admin.base_server import BaseAdminServer
from ...config.base_context import ContextBuilder
from ...config.injection_context import InjectionContext
from ...connections.models.connecti... | 39.261056 | 87 | 0.655476 | import asyncio
from io import StringIO
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from ...admin.base_server import BaseAdminServer
from ...config.base_context import ContextBuilder
from ...config.injection_context import InjectionContext
from ...connections.models.connecti... | true | true |
f76c4923120cb91bc8e549ad2b6f03ad14b63f93 | 1,882 | py | Python | server.py | focusheart/ancientbooksearch | be8d65b59ebf7353b66b4127520e6598a019a6ec | [
"BSD-2-Clause"
] | null | null | null | server.py | focusheart/ancientbooksearch | be8d65b59ebf7353b66b4127520e6598a019a6ec | [
"BSD-2-Clause"
] | null | null | null | server.py | focusheart/ancientbooksearch | be8d65b59ebf7353b66b4127520e6598a019a6ec | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf8 -*-
from flask import Flask, request, session, url_for, redirect, \
render_template, abort, g, flash, send_from_directory, \
jsonify, Response
from elasticsearch import Elasticsearch
import logging
import logging.config
# site config
DEBUG = True
HOST = '0.0.0.0'
PORT = 50407
ES_HOST = 'l... | 22.674699 | 63 | 0.555792 | from flask import Flask, request, session, url_for, redirect, \
render_template, abort, g, flash, send_from_directory, \
jsonify, Response
from elasticsearch import Elasticsearch
import logging
import logging.config
DEBUG = True
HOST = '0.0.0.0'
PORT = 50407
ES_HOST = 'localhost'
ES_INDEX = 'ancientbooks'
ES... | true | true |
f76c496d60815e9fec61dc9f33ea092f944572bb | 3,363 | py | Python | puzzle.py | lbasora/back2python | 76e825049579ebf52e3b3e88003a1c2f53d2062b | [
"MIT"
] | null | null | null | puzzle.py | lbasora/back2python | 76e825049579ebf52e3b3e88003a1c2f53d2062b | [
"MIT"
] | null | null | null | puzzle.py | lbasora/back2python | 76e825049579ebf52e3b3e88003a1c2f53d2062b | [
"MIT"
] | null | null | null | ''' Generic Puzzle Solving Framework
License: MIT
Author: Raymond Hettinger
Simple Instructions:
====================
Create your puzzle as a subclass of Puzzle().
The first step is to choose a representation of the problem
state preferably stored as a string. Set 'pos' to the starting
position and 'goal' to the... | 36.16129 | 105 | 0.691644 |
from collections import deque
from sys import intern
import re
class Puzzle:
pos = ""
goal = ""
def __init__(self, pos=None):
if pos: self.pos = pos
def __repr__(self): return repr(self.pos)
def canonical(self): retur... | true | true |
f76c497bc428766923b75a367787815c5dc9550e | 7,475 | py | Python | sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_cognitive_services_management_client_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_cognitive_services_management_client_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/operations/_cognitive_services_management_client_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 1 | 2021-12-18T20:01:22.000Z | 2021-12-18T20:01:22.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.225806 | 176 | 0.68214 | from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import Async... | true | true |
f76c4be204a62d88104221531accfa68c9ace3e3 | 1,256 | py | Python | server/wechat_service/receive.py | xiaotianyi/INTELLI-City | ef6777b66350b3a3f6aac9c0441d67990ff23cd6 | [
"MIT"
] | null | null | null | server/wechat_service/receive.py | xiaotianyi/INTELLI-City | ef6777b66350b3a3f6aac9c0441d67990ff23cd6 | [
"MIT"
] | null | null | null | server/wechat_service/receive.py | xiaotianyi/INTELLI-City | ef6777b66350b3a3f6aac9c0441d67990ff23cd6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# filename: receive.py
import xml.etree.ElementTree as ET
def parse_xml(web_data):
if len(web_data) == 0:
return None
xmlData = ET.fromstring(web_data)
msg_type = xmlData.find('MsgType').text
if msg_type == 'text':
return TextMsg(xmlData)
elif msg_type == 'i... | 27.911111 | 67 | 0.644108 | import xml.etree.ElementTree as ET
def parse_xml(web_data):
if len(web_data) == 0:
return None
xmlData = ET.fromstring(web_data)
msg_type = xmlData.find('MsgType').text
if msg_type == 'text':
return TextMsg(xmlData)
elif msg_type == 'image':
return ImageMsg(xmlData)
eli... | true | true |
f76c4da72aa5fee07fd4cff835e9bf49a190ea1f | 750 | py | Python | qiskit/circuit/controlflow/__init__.py | mohitd/qiskit-terra | 4a94b770e32215d38d4c0fefc7fefd054ac8a2e2 | [
"Apache-2.0"
] | 1 | 2019-05-22T06:19:56.000Z | 2019-05-22T06:19:56.000Z | qiskit/circuit/controlflow/__init__.py | MaxKelsen/qiskit-terra | 1ec2f5db5fea8df907cace3a0e0c92b6deac7fd3 | [
"Apache-2.0"
] | 12 | 2021-08-31T13:10:01.000Z | 2022-03-30T11:14:58.000Z | qiskit/circuit/controlflow/__init__.py | woodsp-ibm/qiskit-terra | 4301fc47c73507e489dbafc7bae490ab29736daa | [
"Apache-2.0"
] | 1 | 2021-05-25T11:35:55.000Z | 2021-05-25T11:35:55.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 31.25 | 77 | 0.782667 |
from .control_flow import ControlFlowOp
from .if_else import IfElseOp
from .while_loop import WhileLoopOp
from .for_loop import ForLoopOp
from .continue_loop import ContinueLoopOp
from .break_loop import BreakLoopOp
| true | true |
f76c4e1fe5bcd2f3ea7ce5c44ac4095f6cfb4243 | 1,527 | py | Python | upload/scrapers/womakerscode.py | kjaymiller/diversity-orgs-tech-appsearch-demo | 5c11443ef7ef7b7bdac2d89de15627c698154d0c | [
"MIT"
] | 4 | 2021-02-04T19:03:48.000Z | 2021-06-29T00:18:56.000Z | upload/scrapers/womakerscode.py | kjaymiller/diversity-orgs-tech | 5c11443ef7ef7b7bdac2d89de15627c698154d0c | [
"MIT"
] | 11 | 2021-02-20T17:06:37.000Z | 2022-03-18T18:34:54.000Z | upload/scrapers/womakerscode.py | kjaymiller/diversity-orgs-tech | 5c11443ef7ef7b7bdac2d89de15627c698154d0c | [
"MIT"
] | 1 | 2021-04-13T18:59:19.000Z | 2021-04-13T18:59:19.000Z | import re
import httpx
from bs4 import BeautifulSoup
from convert_to_json import hash_id
from cleanup import delete_from_index
from connection import app_search, engine_name
from upload_to_appsearch import upload_dict
womakers_location_page = httpx.get("https://womakerscode.org/locations")
soup = BeautifulSoup(womak... | 29.365385 | 157 | 0.664047 | import re
import httpx
from bs4 import BeautifulSoup
from convert_to_json import hash_id
from cleanup import delete_from_index
from connection import app_search, engine_name
from upload_to_appsearch import upload_dict
womakers_location_page = httpx.get("https://womakerscode.org/locations")
soup = BeautifulSoup(womak... | true | true |
f76c4e30789f32fb5e668fb0441d79f4a9a0a5df | 2,307 | py | Python | trabalho_final/postgres/geo_postgres.py | alvarofpp/ufrn-imd1130-nosql | 6abf0553befa8fd914e1fd19446f6ccf5c35ba05 | [
"MIT"
] | null | null | null | trabalho_final/postgres/geo_postgres.py | alvarofpp/ufrn-imd1130-nosql | 6abf0553befa8fd914e1fd19446f6ccf5c35ba05 | [
"MIT"
] | null | null | null | trabalho_final/postgres/geo_postgres.py | alvarofpp/ufrn-imd1130-nosql | 6abf0553befa8fd914e1fd19446f6ccf5c35ba05 | [
"MIT"
] | null | null | null | import psycopg2;
import time;
import numpy as np
con = psycopg2.connect(
host = "localhost",
database = "mydb",
user = "brunnom",
password = "postgres"
)
cur = con.cursor();
time1km = []
qtd1km = 0;
time15km = []
qtd15km = 0;
time2km = []
qtd2km = 0;
time25km = []
qtd25km = 0;
time3km = []
qtd3km = 0... | 25.633333 | 117 | 0.640225 | import psycopg2;
import time;
import numpy as np
con = psycopg2.connect(
host = "localhost",
database = "mydb",
user = "brunnom",
password = "postgres"
)
cur = con.cursor();
time1km = []
qtd1km = 0;
time15km = []
qtd15km = 0;
time2km = []
qtd2km = 0;
time25km = []
qtd25km = 0;
time3km = []
qtd3km = 0... | true | true |
f76c4e6b9cb5ba1baed1b2e662f63ca33ad3bfef | 309 | py | Python | test/interactive_testing.py | AbdelrahmanRadwan/The-Googlon-Language | 526ca3f8d596f35157d014d67e06e75912ec4d1f | [
"MIT"
] | null | null | null | test/interactive_testing.py | AbdelrahmanRadwan/The-Googlon-Language | 526ca3f8d596f35157d014d67e06e75912ec4d1f | [
"MIT"
] | null | null | null | test/interactive_testing.py | AbdelrahmanRadwan/The-Googlon-Language | 526ca3f8d596f35157d014d67e06e75912ec4d1f | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from language_model.googlon_language import GooglonLanguage
language_model = GooglonLanguage("")
while True:
text = input(">> ")
language_model.update_language_model(text=text)
language_model.print_analytics()
| 23.769231 | 62 | 0.760518 | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from language_model.googlon_language import GooglonLanguage
language_model = GooglonLanguage("")
while True:
text = input(">> ")
language_model.update_language_model(text=text)
language_model.print_analytics()
| true | true |
f76c4e9d527b2b21fa32505099dd75e3f8204009 | 3,096 | py | Python | homeassistant/components/mqtt/discovery.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 4 | 2019-05-14T20:33:43.000Z | 2021-09-25T14:56:08.000Z | homeassistant/components/mqtt/discovery.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/mqtt/discovery.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | null | null | null | """
Support for MQTT discovery.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/mqtt/#discovery
"""
import asyncio
import json
import logging
import re
import homeassistant.components.mqtt as mqtt
from homeassistant.helpers.discovery import async_load_p... | 32.589474 | 79 | 0.653424 | import asyncio
import json
import logging
import re
import homeassistant.components.mqtt as mqtt
from homeassistant.helpers.discovery import async_load_platform
from homeassistant.const import CONF_PLATFORM
from homeassistant.components.mqtt import CONF_STATE_TOPIC
_LOGGER = logging.getLogger(__name__)
TOPIC_MATCHER... | true | true |
f76c4f9b94f5a1716535eab55dbc1e0519829164 | 3,767 | py | Python | recolo/data_structures/read_abaqus_rpts.py | PolymerGuy/recon | 14d66e3d5cb5fcc4868df326b045952daf139291 | [
"MIT"
] | 4 | 2021-10-14T19:52:05.000Z | 2022-03-10T11:41:34.000Z | recolo/data_structures/read_abaqus_rpts.py | PolymerGuy/recolo | 05b14f0834fa675579eabdf43fac046259df19bb | [
"MIT"
] | null | null | null | recolo/data_structures/read_abaqus_rpts.py | PolymerGuy/recolo | 05b14f0834fa675579eabdf43fac046259df19bb | [
"MIT"
] | 1 | 2022-03-04T13:09:01.000Z | 2022-03-04T13:09:01.000Z | import os
import numpy as np
from collections import namedtuple
import logging
from natsort import natsorted
def list_files_in_folder(path, file_type=".rpt",abs_path=False):
""" List all files with a given extension for a given path. The output is sorted
Parameters
----------
path : str
... | 36.572816 | 120 | 0.640297 | import os
import numpy as np
from collections import namedtuple
import logging
from natsort import natsorted
def list_files_in_folder(path, file_type=".rpt",abs_path=False):
if abs_path:
return natsorted([os.path.join(path,file) for file in os.listdir(path) if file.endswith(file_type)])
else:
... | true | true |
f76c4fae2c5959ff426f9fa5c1e5f71f9c2e3b66 | 7,568 | py | Python | tensorflow/contrib/distributions/python/kernel_tests/mvn_full_covariance_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distributions/python/kernel_tests/mvn_full_covariance_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distributions/python/kernel_tests/mvn_full_covariance_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 37.098039 | 81 | 0.645481 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy import stats
from tensorflow.contrib import distributions
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.o... | true | true |
f76c500e1c62fbea467ffb2a789dcf4dba65793e | 725 | py | Python | app.py | SuryanshNaugraiya/Twitter-Sentiment-Analysis | b546ed9180c9763b39c2ba60d29b384b7b18e879 | [
"MIT"
] | null | null | null | app.py | SuryanshNaugraiya/Twitter-Sentiment-Analysis | b546ed9180c9763b39c2ba60d29b384b7b18e879 | [
"MIT"
] | null | null | null | app.py | SuryanshNaugraiya/Twitter-Sentiment-Analysis | b546ed9180c9763b39c2ba60d29b384b7b18e879 | [
"MIT"
] | null | null | null | from flask import Flask,render_template,url_for,request
import pandas as pd
import pickle
import numpy as np
import re
filename = "model.pkl"
cv = pickle.load(open('transform.pkl',"rb"))
clf = pickle.load(open(filename,"rb"))
app = Flask(__name__)
@app.route('/')
def home():
return render_template('... | 29 | 88 | 0.673103 | from flask import Flask,render_template,url_for,request
import pandas as pd
import pickle
import numpy as np
import re
filename = "model.pkl"
cv = pickle.load(open('transform.pkl',"rb"))
clf = pickle.load(open(filename,"rb"))
app = Flask(__name__)
@app.route('/')
def home():
return render_template('... | true | true |
f76c5018093a2edb1d24c275029787b5dd50fe21 | 697 | py | Python | data/inputs-train/python_wrapped/input19.py | vrthra-forks/glade | 45e1f5d3b921548f125aed9d49686ed1583e3e97 | [
"ECL-2.0",
"Apache-2.0"
] | 39 | 2016-09-02T22:14:23.000Z | 2021-12-22T05:39:30.000Z | data/inputs-train/python/input19.py | morellic/glade-full | 2f5bd1ae51b5d4a1c497fa1da265b88774bd4c93 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2015-02-20T02:58:14.000Z | 2015-04-16T19:10:25.000Z | work/benchmarks/test.py | rubyworks/smeagol | 5603ce591b2acdff6e5f5bf7939ef0eaee22cb74 | [
"BSD-2-Clause"
] | 10 | 2017-02-03T22:32:25.000Z | 2020-02-07T08:27:45.000Z | BOARD_SIZE = 8
class BailOut(Exception):
pass
def validate(queens):
left = right = col = queens[-1]
for r in reversed(queens[:-1]):
left, right = left-1, right+1
if r in (left, col, right):
raise BailOut
def add_queen(queens):
for i in range(BOARD_SIZE):
test_queen... | 24.034483 | 70 | 0.552367 | BOARD_SIZE = 8
class BailOut(Exception):
pass
def validate(queens):
left = right = col = queens[-1]
for r in reversed(queens[:-1]):
left, right = left-1, right+1
if r in (left, col, right):
raise BailOut
def add_queen(queens):
for i in range(BOARD_SIZE):
test_queen... | false | true |
f76c5185bf29d5cfad54828c4ef467a2ead5d0a7 | 8,478 | py | Python | tensorflow/contrib/tpu/python/tpu/training_loop.py | jhabikal21/tensorflow | 98d20962172301385aae694141801a375debd2bc | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/tpu/python/tpu/training_loop.py | jhabikal21/tensorflow | 98d20962172301385aae694141801a375debd2bc | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/tpu/python/tpu/training_loop.py | jhabikal21/tensorflow | 98d20962172301385aae694141801a375debd2bc | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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.616822 | 97 | 0.675277 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.tpu.python.tpu import tpu_function
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
def whi... | true | true |
f76c52ddc4bf4e424fc797e7ed8ed2256d10189a | 653 | py | Python | copper/__init__.py | cinepost/Copperfield_FX | 1900b506d0a407a3fb5774ab129b984a547ee0b5 | [
"Unlicense"
] | 6 | 2016-07-28T13:59:34.000Z | 2021-12-28T05:44:15.000Z | copper/__init__.py | cinepost/Copperfield_FX | 1900b506d0a407a3fb5774ab129b984a547ee0b5 | [
"Unlicense"
] | 5 | 2016-06-30T10:19:25.000Z | 2022-03-11T23:19:01.000Z | copper/__init__.py | cinepost/Copperfield_FX | 1900b506d0a407a3fb5774ab129b984a547ee0b5 | [
"Unlicense"
] | 3 | 2019-03-18T05:17:10.000Z | 2020-02-14T06:56:40.000Z | import os
import logging
logger = logging.getLogger(__name__)
os.environ["PYOPENCL_COMPILER_OUTPUT"] = "1"
os.environ["PYOPENCL_NO_CACHE"] = "0"
if not os.environ.get("COPPER_HOME"):
cwd = os.getcwd()
logger.info("Using current directory %s as $COPPER_HOME" % cwd)
os.environ["COPPER_HOME"] = cwd
from co... | 25.115385 | 70 | 0.762634 | import os
import logging
logger = logging.getLogger(__name__)
os.environ["PYOPENCL_COMPILER_OUTPUT"] = "1"
os.environ["PYOPENCL_NO_CACHE"] = "0"
if not os.environ.get("COPPER_HOME"):
cwd = os.getcwd()
logger.info("Using current directory %s as $COPPER_HOME" % cwd)
os.environ["COPPER_HOME"] = cwd
from co... | true | true |
f76c53fa95d1a46b79cc8f9148e1680d586e08be | 92 | py | Python | crowddynamics-qtgui/qtgui/tests/test_gui.py | antonvs88/multiobj-guided-evac | 84d78ac29419011d7af45391f230f50e8cbe30f4 | [
"MIT"
] | 1 | 2019-12-16T14:34:35.000Z | 2019-12-16T14:34:35.000Z | crowddynamics-qtgui/qtgui/tests/test_gui.py | antonvs88/multiobj-guided-evac | 84d78ac29419011d7af45391f230f50e8cbe30f4 | [
"MIT"
] | 1 | 2017-04-24T05:26:55.000Z | 2017-04-24T05:26:55.000Z | crowddynamics-qtgui/qtgui/tests/test_gui.py | antonvs88/optimal-guided-evacuation | ece2e12204bd41596173af5aacc0933acfd6b7c1 | [
"MIT"
] | null | null | null | """
Gui tests
https://github.com/asweigart/pyautogui
"""
def test_gui():
assert True
| 9.2 | 38 | 0.663043 |
def test_gui():
assert True
| true | true |
f76c55a11b2a21786ed21caf5300e1eadaeac69e | 11,494 | py | Python | ext/admin/admin.py | jakobgrine/musicbot | 1382dcbdc47fd0327e0f09ad5ea870c73f5bc956 | [
"MIT"
] | null | null | null | ext/admin/admin.py | jakobgrine/musicbot | 1382dcbdc47fd0327e0f09ad5ea870c73f5bc956 | [
"MIT"
] | null | null | null | ext/admin/admin.py | jakobgrine/musicbot | 1382dcbdc47fd0327e0f09ad5ea870c73f5bc956 | [
"MIT"
] | 3 | 2020-08-03T16:00:36.000Z | 2020-10-23T13:43:37.000Z | import discord
from discord.ext import commands
from PIL import Image
import requests
import numpy
import scipy
import scipy.misc
import scipy.cluster
from .converter import GuildConverter, ExtensionConverter
from . import utils
import io
import traceback
from collections import deque
import asyncio
import speedtest
im... | 44.550388 | 201 | 0.610144 | import discord
from discord.ext import commands
from PIL import Image
import requests
import numpy
import scipy
import scipy.misc
import scipy.cluster
from .converter import GuildConverter, ExtensionConverter
from . import utils
import io
import traceback
from collections import deque
import asyncio
import speedtest
im... | true | true |
f76c55eda5f46de597fc1fceae100dccbb3859e5 | 604 | py | Python | titles/migrations/0002_auto_20210119_1809.py | Dhruvacube/farewell-sc-1 | b09ea161a25c82a3c85b4d5a6353b8c843bcfcec | [
"MIT"
] | 1 | 2021-01-16T05:25:38.000Z | 2021-01-16T05:25:38.000Z | titles/migrations/0002_auto_20210119_1809.py | Dhruvacube/farewell-sc-1 | b09ea161a25c82a3c85b4d5a6353b8c843bcfcec | [
"MIT"
] | 23 | 2021-01-05T07:00:00.000Z | 2021-09-09T05:44:11.000Z | titles/migrations/0002_auto_20210119_1809.py | Dhruvacube/farewell-sc-1 | b09ea161a25c82a3c85b4d5a6353b8c843bcfcec | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-01-19 18:09
import colorfield.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('titles', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='titles',
options={'o... | 25.166667 | 107 | 0.596026 |
import colorfield.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('titles', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='titles',
options={'ordering': ('colour', '-total_vote', 'title_name'... | true | true |
f76c5661461095d9dfe2c02dec734d3c1d7c6243 | 13,919 | py | Python | sdk/kamonohashi/op/rest/models/training_api_models_index_output_model.py | yonetatuu/kamonohashi | dc5840e0bffce0d968b9ae3f25f775ed9562436a | [
"Apache-2.0"
] | 100 | 2019-05-28T10:23:30.000Z | 2022-03-05T06:45:25.000Z | sdk/kamonohashi/op/rest/models/training_api_models_index_output_model.py | yonetatuu/kamonohashi | dc5840e0bffce0d968b9ae3f25f775ed9562436a | [
"Apache-2.0"
] | 354 | 2019-05-28T07:34:10.000Z | 2022-03-31T06:25:34.000Z | sdk/kamonohashi/op/rest/models/training_api_models_index_output_model.py | yonetatuu/kamonohashi | dc5840e0bffce0d968b9ae3f25f775ed9562436a | [
"Apache-2.0"
] | 35 | 2019-05-29T02:50:36.000Z | 2021-10-08T06:13:13.000Z | # coding: utf-8
"""
KAMONOHASHI API
A platform for deep learning # noqa: E501
OpenAPI spec version: v2
Contact: kamonohashi-support@jp.nssol.nipponsteel.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class TrainingAp... | 28.997917 | 271 | 0.619297 |
import pprint
import re
import six
class TrainingApiModelsIndexOutputModel(object):
swagger_types = {
'created_at': 'str',
'created_by': 'str',
'data_set': 'DataSetApiModelsIndexOutputModel',
'display_id': 'int',
'entry_point': 'str',
'favorite': 'bool',
... | true | true |
f76c568fb3af682e2e5be6caf4ebbe6c3a2ade82 | 830 | py | Python | migrations/versions/884fbf8b24ed_.py | tewhalen/chicagodir | 0502a0a8fc6013ff7b16a27b4effb2c117ab09c7 | [
"MIT"
] | 1 | 2022-02-05T22:58:35.000Z | 2022-02-05T22:58:35.000Z | migrations/versions/884fbf8b24ed_.py | tewhalen/chicagodir | 0502a0a8fc6013ff7b16a27b4effb2c117ab09c7 | [
"MIT"
] | 29 | 2022-02-05T17:40:34.000Z | 2022-03-31T14:53:23.000Z | migrations/versions/884fbf8b24ed_.py | tewhalen/chicagodir | 0502a0a8fc6013ff7b16a27b4effb2c117ab09c7 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 884fbf8b24ed
Revises: 84b5ddd15854
Create Date: 2022-02-13 16:31:44.422780
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '884fbf8b24ed'
down_revision = '84b5ddd15854'
branch_labels = None
depends_on = None
def upgrade():
# ... | 26.774194 | 89 | 0.70241 | from alembic import op
import sqlalchemy as sa
revision = '884fbf8b24ed'
down_revision = '84b5ddd15854'
branch_labels = None
depends_on = None
def upgrade():
op.add_column('directories', sa.Column('streetlist_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'directories', 'street_lists', [... | true | true |
f76c5719ad1d521e9039582c58ef7d68326179ae | 809 | py | Python | examples/terminal-in-dialog.py | riag/ptterm | ff359fb44784d84a4360555337fab4510c776d0b | [
"BSD-3-Clause"
] | 20 | 2018-12-04T06:57:49.000Z | 2021-08-28T12:57:44.000Z | examples/terminal-in-dialog.py | riag/ptterm | ff359fb44784d84a4360555337fab4510c776d0b | [
"BSD-3-Clause"
] | 6 | 2019-03-01T16:56:20.000Z | 2021-02-10T19:24:22.000Z | examples/terminal-in-dialog.py | riag/ptterm | ff359fb44784d84a4360555337fab4510c776d0b | [
"BSD-3-Clause"
] | 10 | 2019-01-07T10:47:10.000Z | 2021-08-21T03:43:41.000Z | #!/usr/bin/env python
from __future__ import unicode_literals
from prompt_toolkit.application import Application
from prompt_toolkit.layout import Layout
from prompt_toolkit.layout.dimension import D
from prompt_toolkit.widgets import Dialog
from ptterm import Terminal
def main():
def done():
application.... | 22.472222 | 50 | 0.6267 | from __future__ import unicode_literals
from prompt_toolkit.application import Application
from prompt_toolkit.layout import Layout
from prompt_toolkit.layout.dimension import D
from prompt_toolkit.widgets import Dialog
from ptterm import Terminal
def main():
def done():
application.exit()
term = Ter... | true | true |
f76c58251fb8af55265a624fae991f2ac52e98c7 | 491 | py | Python | Stack/reverse_string.py | sattwik21/Data_Structure_and_Algorithms | b2b708618cdb5e0314cff5ffad93a2c5ba593523 | [
"MIT"
] | 14 | 2019-10-26T11:43:56.000Z | 2021-01-23T00:37:17.000Z | Stack/reverse_string.py | sattwik21/Data_Structure_and_Algorithms | b2b708618cdb5e0314cff5ffad93a2c5ba593523 | [
"MIT"
] | 28 | 2019-10-13T17:49:42.000Z | 2020-11-15T07:08:10.000Z | Stack/reverse_string.py | sattwik21/Data_Structure_and_Algorithms | b2b708618cdb5e0314cff5ffad93a2c5ba593523 | [
"MIT"
] | 73 | 2019-10-11T06:38:10.000Z | 2022-01-26T20:04:24.000Z | """
Python program to reverse a string using stack
"""
def reverse_string(st):
"""
return a string in reverse form
"""
stack = list()
# Push each character into stack
for ch in st:
stack.append(ch)
rev = ""
# Pop each character one by one until stack is not empty
while len... | 18.185185 | 60 | 0.598778 |
def reverse_string(st):
stack = list()
for ch in st:
stack.append(ch)
rev = ""
while len(stack):
rev += stack.pop()
return rev
if __name__ == "__main__":
st = "Test String"
rev = reverse_string(st)
print(rev) | true | true |
f76c595f0dfe9ab39ba1f28b9dd101d62e8deb35 | 831 | py | Python | user/models.py | LeonardoCruzx/ListaTarefasBackend | 81f6bf5f2c64973fa703a3f96bb8cfb491c8b41b | [
"MIT"
] | 1 | 2020-08-26T23:55:33.000Z | 2020-08-26T23:55:33.000Z | user/models.py | LeonardoCruzx/ListaTarefasBackend | 81f6bf5f2c64973fa703a3f96bb8cfb491c8b41b | [
"MIT"
] | null | null | null | user/models.py | LeonardoCruzx/ListaTarefasBackend | 81f6bf5f2c64973fa703a3f96bb8cfb491c8b41b | [
"MIT"
] | null | null | null | from .manager import UserManager
from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
objects = UserManager()
username = None
email = models.EmailField(
null=False,
unique=True,
)
nick = models.CharField(
max_length=30... | 20.775 | 51 | 0.613718 | from .manager import UserManager
from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
objects = UserManager()
username = None
email = models.EmailField(
null=False,
unique=True,
)
nick = models.CharField(
max_length=30... | true | true |
f76c59800d8ea02d8429d24455efbbfe7e666f1a | 938 | py | Python | tests/unit/game_pkchess/character/obj.py | RaenonX/Jelly-Bot-API | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 5 | 2020-08-26T20:12:00.000Z | 2020-12-11T16:39:22.000Z | tests/unit/game_pkchess/character/obj.py | RaenonX/Jelly-Bot | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 234 | 2019-12-14T03:45:19.000Z | 2020-08-26T18:55:19.000Z | tests/unit/game_pkchess/character/obj.py | RaenonX/Jelly-Bot-API | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 2 | 2019-10-23T15:21:15.000Z | 2020-05-22T09:35:55.000Z | from game.pkchess.character import Character
from game.pkchess.utils.character import get_character_template
from tests.base import TestCase
__all__ = ["TestCharacter"]
class TestCharacter(TestCase):
def test_character_from_template(self):
template = get_character_template("Nearnox")
chara = Cha... | 36.076923 | 63 | 0.717484 | from game.pkchess.character import Character
from game.pkchess.utils.character import get_character_template
from tests.base import TestCase
__all__ = ["TestCharacter"]
class TestCharacter(TestCase):
def test_character_from_template(self):
template = get_character_template("Nearnox")
chara = Cha... | true | true |
f76c59d07b64952f08165c19e49eafed4d8b0c80 | 3,618 | py | Python | utils/training_utils/ssd_vgg16.py | Jaskaran197/Red-blood-cell-detection-SSD | a33b330ad17454a7425aa7f57818c0a41b4e0ff9 | [
"MIT"
] | null | null | null | utils/training_utils/ssd_vgg16.py | Jaskaran197/Red-blood-cell-detection-SSD | a33b330ad17454a7425aa7f57818c0a41b4e0ff9 | [
"MIT"
] | null | null | null | utils/training_utils/ssd_vgg16.py | Jaskaran197/Red-blood-cell-detection-SSD | a33b330ad17454a7425aa7f57818c0a41b4e0ff9 | [
"MIT"
] | null | null | null | import os
from losses import SSD_LOSS
from utils import data_utils
from networks import SSD_VGG16
import tensorflow as tf
from tensorflow.keras.optimizers import SGD, Adam
from data_generators import SSD_DATA_GENERATOR
from tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger, TerminateOnNaN, LearningRateSchedu... | 32.594595 | 104 | 0.66031 | import os
from losses import SSD_LOSS
from utils import data_utils
from networks import SSD_VGG16
import tensorflow as tf
from tensorflow.keras.optimizers import SGD, Adam
from data_generators import SSD_DATA_GENERATOR
from tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger, TerminateOnNaN, LearningRateSchedu... | true | true |
f76c5e533b529030ac067e86cb6cecc9193892b6 | 162 | py | Python | utils/urls.py | DenerRodrigues/cheffapp-api | 498e9c96102f9bc777158b7aa07a99d89afa6a39 | [
"MIT"
] | 1 | 2020-03-23T03:21:43.000Z | 2020-03-23T03:21:43.000Z | utils/urls.py | DenerRodrigues/cheffapp-api | 498e9c96102f9bc777158b7aa07a99d89afa6a39 | [
"MIT"
] | 5 | 2021-03-19T01:03:34.000Z | 2021-06-10T18:44:34.000Z | utils/urls.py | DenerRodrigues/chefapp-api | 498e9c96102f9bc777158b7aa07a99d89afa6a39 | [
"MIT"
] | null | null | null | from django.urls import include, path
from . import views as utils_views
urlpatterns = [
path('address/<cep>/', utils_views.AddressByCepView.as_view()),
]
| 18 | 67 | 0.728395 | from django.urls import include, path
from . import views as utils_views
urlpatterns = [
path('address/<cep>/', utils_views.AddressByCepView.as_view()),
]
| true | true |
f76c5f8519e0d1b68e1912be51fb18c439f81d4d | 727 | py | Python | test_learn.py | qipeng/cudamat | a346369447e9b2dbb730e4218a4c0eaa153840ef | [
"BSD-3-Clause"
] | 2 | 2017-06-22T20:27:25.000Z | 2017-06-22T20:27:34.000Z | test_learn.py | luisitobarcito/cudamat | a346369447e9b2dbb730e4218a4c0eaa153840ef | [
"BSD-3-Clause"
] | null | null | null | test_learn.py | luisitobarcito/cudamat | a346369447e9b2dbb730e4218a4c0eaa153840ef | [
"BSD-3-Clause"
] | 1 | 2020-06-21T06:28:17.000Z | 2020-06-21T06:28:17.000Z | import pdb
import numpy as np
import nose
import cudamat as cm
import learn as cl
def setup():
cm.cublas_init()
def teardown():
cm.cublas_shutdown()
def test_mult_by_sigmoid_deriv():
m = 256
n = 128
c_targets = np.array(np.random.randn(m, n)*10, dtype=np.float32, order='F')
c_acts = np.array(... | 25.068966 | 128 | 0.689133 | import pdb
import numpy as np
import nose
import cudamat as cm
import learn as cl
def setup():
cm.cublas_init()
def teardown():
cm.cublas_shutdown()
def test_mult_by_sigmoid_deriv():
m = 256
n = 128
c_targets = np.array(np.random.randn(m, n)*10, dtype=np.float32, order='F')
c_acts = np.array(... | true | true |
f76c5ff6c856e107d2f37cb714209908e4e6b59e | 17,020 | py | Python | test/test_msteam_plugin.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 4,764 | 2018-02-02T18:17:06.000Z | 2022-03-31T20:41:13.000Z | test/test_msteam_plugin.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 504 | 2017-11-26T15:56:14.000Z | 2022-03-31T22:38:49.000Z | test/test_msteam_plugin.py | linkmauve/apprise | 76700bfa1ddcb2812d9ed14dfa7736125bcd346e | [
"MIT"
] | 217 | 2018-05-22T14:29:20.000Z | 2022-03-28T06:24:46.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 th... | 31.001821 | 79 | 0.618214 |
import mock
import json
import requests
import pytest
from apprise import Apprise
from apprise import AppriseConfig
from apprise import plugins
from apprise import NotifyType
import logging
logging.disable(logging.CRITICAL)
@mock.patch('requests.post')
def test_msteams_templating(mock_post, tmpdir):
plugins... | true | true |
f76c601845ef60dbac324e1aea901b9eb517fcd7 | 7,296 | py | Python | dialobot/core/intent/pipeline.py | aiaaua/dialobot | 24e9700a7b7aba91542ec55abb64a67ce7002d92 | [
"Apache-2.0"
] | 13 | 2021-05-21T06:19:19.000Z | 2022-01-10T10:08:30.000Z | dialobot/core/intent/pipeline.py | aiaaua/dialobot | 24e9700a7b7aba91542ec55abb64a67ce7002d92 | [
"Apache-2.0"
] | 7 | 2021-05-27T12:27:35.000Z | 2021-07-04T11:49:58.000Z | dialobot/core/intent/pipeline.py | aiaaua/dialobot | 24e9700a7b7aba91542ec55abb64a67ce7002d92 | [
"Apache-2.0"
] | 5 | 2021-05-21T07:20:08.000Z | 2022-01-18T06:20:44.000Z | # Copyright (c) 2021, Hyunwoong Ko. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 34.253521 | 125 | 0.534402 |
import os
from collections import Counter
from typing import List, Union, Dict, Any, Tuple
from dialobot.core.base import IntentBase
from dialobot.core.utils.const import MODEL_ALIAS
from dialobot.core.intent.classifier import IntentClassifier
from dialobot.core.intent.retriever import IntentRetriever
class Intent(... | true | true |
f76c60a478a07b3cad58f2dc9ffeefb08f2d2eb0 | 1,970 | py | Python | lib/galaxy/model/migrate/versions/0041_workflow_invocation.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 2 | 2017-03-28T12:11:41.000Z | 2017-04-22T02:58:25.000Z | lib/galaxy/model/migrate/versions/0041_workflow_invocation.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 12 | 2020-07-24T23:55:19.000Z | 2021-12-19T11:40:06.000Z | lib/galaxy/model/migrate/versions/0041_workflow_invocation.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 1 | 2019-01-16T22:21:54.000Z | 2019-01-16T22:21:54.000Z | """
Migration script to create tables for tracking workflow invocations.
"""
from __future__ import print_function
import datetime
import logging
from sqlalchemy import (
Column,
DateTime,
ForeignKey,
Integer,
MetaData,
Table
)
from galaxy.model.migrate.versions.util import (
create_table... | 33.389831 | 145 | 0.617766 | from __future__ import print_function
import datetime
import logging
from sqlalchemy import (
Column,
DateTime,
ForeignKey,
Integer,
MetaData,
Table
)
from galaxy.model.migrate.versions.util import (
create_table,
drop_table
)
log = logging.getLogger(__name__)
now = datetime.datetime... | true | true |
f76c6121e8a968dc20e3db9dec94b53c3be37abd | 6,668 | py | Python | synapse/storage/databases/main/directory.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | null | null | null | synapse/storage/databases/main/directory.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | null | null | null | synapse/storage/databases/main/directory.py | dsonck92/synapse | 2560b1b6b2f74b5724253396c0e3665fa1f7968c | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 32.368932 | 88 | 0.60213 |
from typing import Iterable, List, Optional, Tuple
import attr
from synapse.api.errors import SynapseError
from synapse.storage.database import LoggingTransaction
from synapse.storage.databases.main import CacheInvalidationWorkerStore
from synapse.types import RoomAlias
from synapse.util.caches.descriptors import ca... | true | true |
f76c6138f8e0ea8793f0daf6279cda4974a4eb75 | 909 | py | Python | app/access_control/management/commands/base_button_role.py | 21vcloud/Controller | 63169d220f412330a22e3a2fe9964c73893d4e0f | [
"Apache-2.0"
] | null | null | null | app/access_control/management/commands/base_button_role.py | 21vcloud/Controller | 63169d220f412330a22e3a2fe9964c73893d4e0f | [
"Apache-2.0"
] | null | null | null | app/access_control/management/commands/base_button_role.py | 21vcloud/Controller | 63169d220f412330a22e3a2fe9964c73893d4e0f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from django.core.management.base import BaseCommand
from common.access_control.base import AccessSet
from account.repository.auth_models import BmProject
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('-project_name')
def handle(s... | 32.464286 | 68 | 0.666667 |
import os
from django.core.management.base import BaseCommand
from common.access_control.base import AccessSet
from account.repository.auth_models import BmProject
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('-project_name')
def handle(self, *args, **options):
... | true | true |
f76c61ded88598ca8b786ee298de7c2cb9e82a4c | 1,515 | py | Python | djangular/tests/test_middleware.py | mohamedmehdigara/djangular | 4fc13bbe9c94799734cd08f31ac9ed46c0a2a3b7 | [
"Apache-2.0"
] | 145 | 2015-01-01T12:09:30.000Z | 2022-01-28T13:59:50.000Z | djangular/tests/test_middleware.py | mohamedmehdigara/djangular | 4fc13bbe9c94799734cd08f31ac9ed46c0a2a3b7 | [
"Apache-2.0"
] | 25 | 2015-01-07T11:42:21.000Z | 2016-12-14T19:23:45.000Z | djangular/tests/test_middleware.py | mohamedmehdigara/djangular | 4fc13bbe9c94799734cd08f31ac9ed46c0a2a3b7 | [
"Apache-2.0"
] | 40 | 2015-02-07T13:23:09.000Z | 2022-01-28T13:59:53.000Z | from djangular import middleware
from django.test import SimpleTestCase
from django.http import HttpRequest, HttpResponse
class AngularJsonVulnerabilityMiddlewareTest(SimpleTestCase):
def test_that_middleware_does_nothing_to_html_requests(self):
resp = HttpResponse(content_type='text/html', content='<ht... | 42.083333 | 93 | 0.731353 | from djangular import middleware
from django.test import SimpleTestCase
from django.http import HttpRequest, HttpResponse
class AngularJsonVulnerabilityMiddlewareTest(SimpleTestCase):
def test_that_middleware_does_nothing_to_html_requests(self):
resp = HttpResponse(content_type='text/html', content='<ht... | true | true |
f76c630df0b9c4e6e8ce8c5b5bb9df82db1d198f | 466 | py | Python | tests/test_highlight.py | zazbone/bin-server | 9cfa02e7f722c91a128729c717749018c23eade9 | [
"MIT"
] | 22 | 2020-10-23T01:19:29.000Z | 2021-01-30T09:05:01.000Z | tests/test_highlight.py | zazbone/bin-server | 9cfa02e7f722c91a128729c717749018c23eade9 | [
"MIT"
] | 75 | 2020-10-25T20:59:13.000Z | 2021-02-09T07:15:57.000Z | tests/test_highlight.py | zazbone/bin-server | 9cfa02e7f722c91a128729c717749018c23eade9 | [
"MIT"
] | 17 | 2020-10-25T21:00:31.000Z | 2021-01-16T16:40:24.000Z | import unittest
import pygments
from bin import highlight
class TestHighlight(unittest.TestCase):
@staticmethod
def has_language_formatter(lang):
try:
pygments.lexers.get_lexer_by_name(lang)
return True
except pygments.utils.ClassNotFound:
return False
d... | 27.411765 | 65 | 0.693133 | import unittest
import pygments
from bin import highlight
class TestHighlight(unittest.TestCase):
@staticmethod
def has_language_formatter(lang):
try:
pygments.lexers.get_lexer_by_name(lang)
return True
except pygments.utils.ClassNotFound:
return False
d... | true | true |
f76c6346cd739fa7d37cea8c8351b042a6ff0db9 | 1,080 | py | Python | setup.py | heslegrave/connectedcars-python | 29dca7bb33d549dbb4803688032ae3a13b932eba | [
"MIT"
] | 1 | 2021-04-02T17:25:20.000Z | 2021-04-02T17:25:20.000Z | setup.py | heslegrave/connectedcars-python | 29dca7bb33d549dbb4803688032ae3a13b932eba | [
"MIT"
] | null | null | null | setup.py | heslegrave/connectedcars-python | 29dca7bb33d549dbb4803688032ae3a13b932eba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
with open('README.md', 'r') as file:
long_description = file.read()
with open('requirements.txt') as file:
install_requires = [line.rstrip('\r\n') for line in file]
setup(
name = 'connectedcars',
packages = ['connectedcars'],
version = '0.1.3',
licen... | 36 | 170 | 0.700926 | from setuptools import setup
with open('README.md', 'r') as file:
long_description = file.read()
with open('requirements.txt') as file:
install_requires = [line.rstrip('\r\n') for line in file]
setup(
name = 'connectedcars',
packages = ['connectedcars'],
version = '0.1.3',
license = 'MIT',
descript... | true | true |
f76c645660bbe6a6a2f5e078dc5400d4b98402c3 | 81,783 | py | Python | bigquery/docs/snippets.py | munkhuushmgl/google-cloud-python | 6bd28e7fa72a32c73434f5cac9efcb5153a9ed9e | [
"Apache-2.0"
] | null | null | null | bigquery/docs/snippets.py | munkhuushmgl/google-cloud-python | 6bd28e7fa72a32c73434f5cac9efcb5153a9ed9e | [
"Apache-2.0"
] | null | null | null | bigquery/docs/snippets.py | munkhuushmgl/google-cloud-python | 6bd28e7fa72a32c73434f5cac9efcb5153a9ed9e | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 36.043632 | 88 | 0.697431 |
import os
import time
import pytest
import six
try:
import fastparquet
except (ImportError, AttributeError):
fastparquet = None
try:
import pandas
except (ImportError, AttributeError):
pandas = None
try:
import pyarrow
except (ImportError, AttributeError):
pyarrow = None
from google.api_cor... | true | true |
f76c649172c81fa2c0a71e638556607e47801ab8 | 8,280 | py | Python | jans-linux-setup/jans_setup/setup_app/installers/httpd.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | null | null | null | jans-linux-setup/jans_setup/setup_app/installers/httpd.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | null | null | null | jans-linux-setup/jans_setup/setup_app/installers/httpd.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | null | null | null | import os
import glob
import shutil
from setup_app import paths
from setup_app.utils import base
from setup_app.static import AppType, InstallOption
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtils
from setup_app.installers.base import BaseInstaller
class HttpdInstaller(BaseInsta... | 42.461538 | 294 | 0.599275 | import os
import glob
import shutil
from setup_app import paths
from setup_app.utils import base
from setup_app.static import AppType, InstallOption
from setup_app.config import Config
from setup_app.utils.setup_utils import SetupUtils
from setup_app.installers.base import BaseInstaller
class HttpdInstaller(BaseInsta... | true | true |
f76c64f739a62c3c8629fed4dd311d82a9bac333 | 11,738 | py | Python | homeassistant/components/template/vacuum.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2020-11-27T06:26:27.000Z | 2020-12-09T14:55:16.000Z | homeassistant/components/template/vacuum.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 25 | 2021-11-24T06:24:10.000Z | 2022-03-31T06:23:06.000Z | homeassistant/components/template/vacuum.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """Support for Template vacuums."""
from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant.components.vacuum import (
ATTR_FAN_SPEED,
DOMAIN as VACUUM_DOMAIN,
SERVICE_CLEAN_SPOT,
SERVICE_LOCATE,
SERVICE_PAUSE,
SERVICE_RETURN_TO_BASE,
SERVICE_SET_FAN_... | 31.810298 | 87 | 0.643721 | from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant.components.vacuum import (
ATTR_FAN_SPEED,
DOMAIN as VACUUM_DOMAIN,
SERVICE_CLEAN_SPOT,
SERVICE_LOCATE,
SERVICE_PAUSE,
SERVICE_RETURN_TO_BASE,
SERVICE_SET_FAN_SPEED,
SERVICE_START,
SERVIC... | true | true |
f76c65aebc4349d2cf7ca689545ab2f6608fc6e6 | 21,254 | py | Python | Chapter04/cycledGAN_edges_to_bags.py | GeniusDog/Intelligent-Projects-Using-Python | ca4650abb0c477b28a5698032835ea993cb08bd4 | [
"MIT"
] | 105 | 2019-02-01T16:55:10.000Z | 2022-03-20T11:43:59.000Z | Chapter04/cycledGAN_edges_to_bags.py | GeniusDog/Intelligent-Projects-Using-Python | ca4650abb0c477b28a5698032835ea993cb08bd4 | [
"MIT"
] | null | null | null | Chapter04/cycledGAN_edges_to_bags.py | GeniusDog/Intelligent-Projects-Using-Python | ca4650abb0c477b28a5698032835ea993cb08bd4 | [
"MIT"
] | 96 | 2019-02-01T16:55:12.000Z | 2022-03-25T04:02:02.000Z | from __future__ import print_function, division
#import scipy
import tensorflow as tf
import datetime
import matplotlib.pyplot as plt
#import sys
#from data_loader import DataLoader
import numpy as np
import os
import time
import glob
from scipy.misc import imread,imresize,imsave
import copy
import fire
from elapsedti... | 43.73251 | 176 | 0.577821 | from __future__ import print_function, division
import tensorflow as tf
import datetime
import matplotlib.pyplot as plt
import numpy as np
import os
import time
import glob
from scipy.misc import imread,imresize,imsave
import copy
import fire
from elapsedtimer import ElapsedTimer
def load_train_data(image_path, load... | true | true |
f76c679269e759ce12a41d513ab1420a08002401 | 2,357 | py | Python | src/rgt/motifanalysis/Motif.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | src/rgt/motifanalysis/Motif.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | src/rgt/motifanalysis/Motif.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | ###################################################################################################
# Libraries
###################################################################################################
from __future__ import division
# Python 3 compatibility
from __future__ import print_function
# Python
fr... | 32.736111 | 99 | 0.515062 |
from __future__ import division
from __future__ import print_function
from os.path import basename
from MOODS import tools, parsers
from numpy import argmax
class Motif:
def __init__(self, input_file_name, pseudocounts, threshold):
self.name = ".".join(basename(input_file_name).split(".")... | true | true |
f76c696af22066bacd1a5a4b0fcdaccd02b2c67b | 198 | py | Python | todo/views.py | kseniia-grishchenko/to-do-site | 6b1d4a285aa2ae15d285b1a60f98420c12e8e20b | [
"Apache-2.0"
] | null | null | null | todo/views.py | kseniia-grishchenko/to-do-site | 6b1d4a285aa2ae15d285b1a60f98420c12e8e20b | [
"Apache-2.0"
] | null | null | null | todo/views.py | kseniia-grishchenko/to-do-site | 6b1d4a285aa2ae15d285b1a60f98420c12e8e20b | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from todo.models import Task
def todo(request):
tasks = Task.objects.all()
print(tasks)
return render(request, 'todo/todo.html', {'tasks': tasks})
| 19.8 | 62 | 0.70202 | from django.shortcuts import render
from todo.models import Task
def todo(request):
tasks = Task.objects.all()
print(tasks)
return render(request, 'todo/todo.html', {'tasks': tasks})
| true | true |
f76c697a2c8102837bc591064a4fac52f74894b2 | 117,402 | py | Python | tests/python/frontend/pytorch/test_forward.py | zhenlohuang/tvm | fd2e6d17120a79533852c6bb705429d9c7bc286b | [
"Apache-2.0"
] | 1 | 2021-06-08T11:55:55.000Z | 2021-06-08T11:55:55.000Z | tests/python/frontend/pytorch/test_forward.py | zhenlohuang/tvm | fd2e6d17120a79533852c6bb705429d9c7bc286b | [
"Apache-2.0"
] | null | null | null | tests/python/frontend/pytorch/test_forward.py | zhenlohuang/tvm | fd2e6d17120a79533852c6bb705429d9c7bc286b | [
"Apache-2.0"
] | null | null | null | # 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... | 32.485335 | 115 | 0.630015 | from time import time
import os
import sys
from scipy.stats import t as tdistr
import numpy as np
import torch
import torchvision
from torch.nn import Module
import tvm
from tvm import relay
from tvm.contrib import graph_runtime
from tvm.contrib.nvcc import have_fp16
import tvm.testing
from packaging import version as ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.