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
f752351d78e28d4524a2dfce186a3e5dce0fdac9
2,653
py
Python
backend/views/prices.py
colinmcintosh/Savvy
67fb6490aeb94ae91c610f514d0d67e3f548c3b9
[ "MIT" ]
null
null
null
backend/views/prices.py
colinmcintosh/Savvy
67fb6490aeb94ae91c610f514d0d67e3f548c3b9
[ "MIT" ]
null
null
null
backend/views/prices.py
colinmcintosh/Savvy
67fb6490aeb94ae91c610f514d0d67e3f548c3b9
[ "MIT" ]
null
null
null
import json from flask import Blueprint from flask import request from flask import Response from backend.auth import login_required, current_user from backend.models.prices import PriceDB from backend.utils import json_error, json_success, crossdomain price_blueprint = Blueprint("prices", __name__, url_prefix="/api...
31.963855
97
0.646815
import json from flask import Blueprint from flask import request from flask import Response from backend.auth import login_required, current_user from backend.models.prices import PriceDB from backend.utils import json_error, json_success, crossdomain price_blueprint = Blueprint("prices", __name__, url_prefix="/api...
true
true
f75235992d05456e1c97a952681a2ac29a48774f
2,260
py
Python
tests/test_class_oelint_vars_notrailingslash.py
Rahix/oelint-adv
b9dc381b181a8bdc7300bb5070f80bf90950efbd
[ "BSD-2-Clause" ]
null
null
null
tests/test_class_oelint_vars_notrailingslash.py
Rahix/oelint-adv
b9dc381b181a8bdc7300bb5070f80bf90950efbd
[ "BSD-2-Clause" ]
null
null
null
tests/test_class_oelint_vars_notrailingslash.py
Rahix/oelint-adv
b9dc381b181a8bdc7300bb5070f80bf90950efbd
[ "BSD-2-Clause" ]
null
null
null
import os import sys import pytest sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) from base import TestBaseClass class TestClassOelintVarsNoTrailingSlash(TestBaseClass): @pytest.mark.parametrize('id', ['oelint.vars.notrailingslash']) @pytest.mark.parametrize('occurance', [1]) @pytest.ma...
23.541667
67
0.375664
import os import sys import pytest sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) from base import TestBaseClass class TestClassOelintVarsNoTrailingSlash(TestBaseClass): @pytest.mark.parametrize('id', ['oelint.vars.notrailingslash']) @pytest.mark.parametrize('occurance', [1]) @pytest.ma...
true
true
f752362593310dfe42aafcd8d000c9261a2cb16c
3,754
py
Python
python/venv/lib/python2.7/site-packages/openstack/tests/unit/test_connection.py
sjsucohort6/openstack
8471e6e599c3f52319926a582358358ef84cbadb
[ "MIT" ]
null
null
null
python/venv/lib/python2.7/site-packages/openstack/tests/unit/test_connection.py
sjsucohort6/openstack
8471e6e599c3f52319926a582358358ef84cbadb
[ "MIT" ]
null
null
null
python/venv/lib/python2.7/site-packages/openstack/tests/unit/test_connection.py
sjsucohort6/openstack
8471e6e599c3f52319926a582358358ef84cbadb
[ "MIT" ]
null
null
null
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
42.659091
75
0.628929
import mock from openstack.auth.identity import v2 from openstack import connection from openstack import profile from openstack.tests.unit import base from openstack import transport class TestConnection(base.TestCase): def setUp(self): super(TestConnection, self).setUp() self.xport = transport...
true
true
f7523712f04d92834cf09420a4cb3259a34f8e23
1,627
py
Python
p2p.py
MartinKist/p2p
046c6258f936789aff73b884235b9b202e7e7f7a
[ "MIT" ]
2
2021-06-29T11:32:59.000Z
2021-06-30T09:11:24.000Z
p2p.py
MartinKist/p2p
046c6258f936789aff73b884235b9b202e7e7f7a
[ "MIT" ]
null
null
null
p2p.py
MartinKist/p2p
046c6258f936789aff73b884235b9b202e7e7f7a
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # (c) 2021 Martin Kistler import argparse import sys from twisted.logger import globalLogPublisher, ILogObserver, eventAsText from zope.interface import provider import requests import defaults from client import P2PClient # argument parsing parser = argparse.ArgumentParser() parser.add_argum...
31.288462
117
0.687154
import argparse import sys from twisted.logger import globalLogPublisher, ILogObserver, eventAsText from zope.interface import provider import requests import defaults from client import P2PClient parser = argparse.ArgumentParser() parser.add_argument('--debug', help='set logging level to debug', action='store_true...
true
true
f7523828fbbea5ee9cdb72f75ec29ba98025b9ea
10,941
py
Python
examples/inspection/plot_partial_dependence.py
Ben3940/scikit-learn
adb47e7c142ce6d699cc5927925d448cb2c1ab91
[ "BSD-3-Clause" ]
null
null
null
examples/inspection/plot_partial_dependence.py
Ben3940/scikit-learn
adb47e7c142ce6d699cc5927925d448cb2c1ab91
[ "BSD-3-Clause" ]
null
null
null
examples/inspection/plot_partial_dependence.py
Ben3940/scikit-learn
adb47e7c142ce6d699cc5927925d448cb2c1ab91
[ "BSD-3-Clause" ]
null
null
null
""" =============================================================== Partial Dependence and Individual Conditional Expectation Plots =============================================================== Partial dependence plots show the dependence between the target function [2]_ and a set of features of interest, marginaliz...
37.597938
88
0.734211
import pandas as pd from sklearn.datasets import fetch_california_housing from sklearn.model_selection import train_test_split cal_housing = fetch_california_housing() X = pd.DataFrame(cal_housing.data, columns=cal_housing.feature_names) y = cal_housing.target y -= y.mean() X_train, X_test, y_train, y_test = train...
true
true
f7523861bf3ca34a23a663797de8153b5213a447
2,555
py
Python
setup.py
AndersonReyes/jupyterlab_templates
d8f13ff4c10f041591f0498782b832118d66705e
[ "Apache-2.0" ]
null
null
null
setup.py
AndersonReyes/jupyterlab_templates
d8f13ff4c10f041591f0498782b832118d66705e
[ "Apache-2.0" ]
null
null
null
setup.py
AndersonReyes/jupyterlab_templates
d8f13ff4c10f041591f0498782b832118d66705e
[ "Apache-2.0" ]
null
null
null
from codecs import open from os import path from jupyter_packaging import ( combine_commands, create_cmdclass, ensure_python, ensure_targets, get_version, install_npm, ) from setuptools import find_packages, setup pjoin = path.join ensure_python(("2.7", ">=3.7")) name = "jupyterlab_templates...
26.340206
80
0.631311
from codecs import open from os import path from jupyter_packaging import ( combine_commands, create_cmdclass, ensure_python, ensure_targets, get_version, install_npm, ) from setuptools import find_packages, setup pjoin = path.join ensure_python(("2.7", ">=3.7")) name = "jupyterlab_templates...
true
true
f7523898d6fb07826bfe1203d523e0cc30de6ec5
1,730
py
Python
synthetic_sounds/classification_problems.py
i2mint/examples
1dd52935f6f6175a17af9b8e5ee9e2b10b08cb7f
[ "Apache-2.0" ]
null
null
null
synthetic_sounds/classification_problems.py
i2mint/examples
1dd52935f6f6175a17af9b8e5ee9e2b10b08cb7f
[ "Apache-2.0" ]
1
2020-03-30T21:50:54.000Z
2020-03-30T21:50:54.000Z
synthetic_sounds/classification_problems.py
i2mint/examples
1dd52935f6f6175a17af9b8e5ee9e2b10b08cb7f
[ "Apache-2.0" ]
1
2019-08-18T22:47:51.000Z
2019-08-18T22:47:51.000Z
from typing import Iterable, Callable import numpy as np from examples.synthetic_sounds.util import ( seeds_to_wfs, seed_to_wf_chk, DFLT_SEEDS, DFLT_CHUNKER, chk_tag_gen, frame_annots_to_chk_annots, ) from sklearn.decomposition import PCA from sklearn.svm import SVC def make_frequency_groups(s...
27.903226
85
0.685549
from typing import Iterable, Callable import numpy as np from examples.synthetic_sounds.util import ( seeds_to_wfs, seed_to_wf_chk, DFLT_SEEDS, DFLT_CHUNKER, chk_tag_gen, frame_annots_to_chk_annots, ) from sklearn.decomposition import PCA from sklearn.svm import SVC def make_frequency_groups(s...
true
true
f75238a12046175b7cad155f9f2693e75d908a2d
20,567
py
Python
sympy/geometry/entity.py
utkarshdeorah/sympy
dcdf59bbc6b13ddbc329431adf72fcee294b6389
[ "BSD-3-Clause" ]
1
2022-01-31T16:02:46.000Z
2022-01-31T16:02:46.000Z
sympy/geometry/entity.py
utkarshdeorah/sympy
dcdf59bbc6b13ddbc329431adf72fcee294b6389
[ "BSD-3-Clause" ]
null
null
null
sympy/geometry/entity.py
utkarshdeorah/sympy
dcdf59bbc6b13ddbc329431adf72fcee294b6389
[ "BSD-3-Clause" ]
1
2022-02-04T13:50:29.000Z
2022-02-04T13:50:29.000Z
"""The definition of the base geometrical entity with attributes common to all derived geometrical entities. Contains ======== GeometryEntity GeometricSet Notes ===== A GeometryEntity is any object that has special geometric properties. A GeometrySet is a superclass of any GeometryEntity that can also be viewed as ...
32.388976
130
0.573686
from sympy.core.basic import Basic from sympy.core.containers import Tuple from sympy.core.evalf import EvalfMixin, N from sympy.core.numbers import oo from sympy.core.symbol import Dummy from sympy.core.sympify import sympify from sympy.functions.elementary.trigonometric import cos, sin, atan from sympy.matrices impo...
true
true
f75238d477768e6c79e3bbf3c8a9725739a7c0a1
1,216
py
Python
generate_data.py
not-a-hot-dog/parallelized-disease-modeling
e82d052b4841f1c545f4f5c65ce509f1a3418754
[ "MIT" ]
null
null
null
generate_data.py
not-a-hot-dog/parallelized-disease-modeling
e82d052b4841f1c545f4f5c65ce509f1a3418754
[ "MIT" ]
null
null
null
generate_data.py
not-a-hot-dog/parallelized-disease-modeling
e82d052b4841f1c545f4f5c65ce509f1a3418754
[ "MIT" ]
1
2020-05-05T21:30:07.000Z
2020-05-05T21:30:07.000Z
import numpy as np ##Read in data matrix data = np.load("data/matrix.npy") print('Creating data...') ##Generate individual CSVs S_init_data = data[:, :, 2] I_init_data = data[:, :, 3] R_init_data = data[:, :, 4] isUS_data = data[:, :, 5] #Use fixed beta and gamma for stable simulation beta_data = 0.8 * np.ones(S_init...
35.764706
57
0.691612
import numpy as np data = np.load("data/matrix.npy") print('Creating data...') S_init_data = data[:, :, 2] I_init_data = data[:, :, 3] R_init_data = data[:, :, 4] isUS_data = data[:, :, 5] beta_data = 0.8 * np.ones(S_init_data.shape) gamma_data = 0.01 * np.ones(S_init_data.shape) dS_data = 0.01 * np.ones(S_init_data....
true
true
f75238d6457c8357a5da67ab39ff93226c3f90cb
1,266
py
Python
checkov/cloudformation/checks/resource/aws/EKSSecretsEncryption.py
niradler/checkov
2628c6f28a5604efe3877d6eacc3044d2b66b7b1
[ "Apache-2.0" ]
4,013
2019-12-09T13:16:54.000Z
2022-03-31T14:31:01.000Z
checkov/cloudformation/checks/resource/aws/EKSSecretsEncryption.py
niradler/checkov
2628c6f28a5604efe3877d6eacc3044d2b66b7b1
[ "Apache-2.0" ]
1,258
2019-12-17T09:55:51.000Z
2022-03-31T19:17:17.000Z
checkov/cloudformation/checks/resource/aws/EKSSecretsEncryption.py
niradler/checkov
2628c6f28a5604efe3877d6eacc3044d2b66b7b1
[ "Apache-2.0" ]
638
2019-12-19T08:57:38.000Z
2022-03-30T21:38:37.000Z
from checkov.common.models.enums import CheckResult, CheckCategories from checkov.cloudformation.checks.resource.base_resource_check import BaseResourceCheck class EKSSecretsEncryption(BaseResourceCheck): def __init__(self): name = "Ensure EKS Cluster has Secrets Encryption Enabled" id = "CKV_AWS_...
45.214286
123
0.71564
from checkov.common.models.enums import CheckResult, CheckCategories from checkov.cloudformation.checks.resource.base_resource_check import BaseResourceCheck class EKSSecretsEncryption(BaseResourceCheck): def __init__(self): name = "Ensure EKS Cluster has Secrets Encryption Enabled" id = "CKV_AWS_...
true
true
f75239a8db622ce41a2a38d0e066d8c23a60758a
4,520
py
Python
vendor-local/lib/python/celery/tests/test_backends/test_redis_unit.py
Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c
f80e7c0cff97a1e9b301aa04015db983c7645778
[ "BSD-3-Clause" ]
4
2015-05-08T16:58:53.000Z
2019-09-06T05:30:59.000Z
vendor-local/lib/python/celery/tests/test_backends/test_redis_unit.py
Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c
f80e7c0cff97a1e9b301aa04015db983c7645778
[ "BSD-3-Clause" ]
2
2019-02-17T17:44:53.000Z
2019-03-28T03:54:39.000Z
vendor-local/lib/python/celery/tests/test_backends/test_redis_unit.py
Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c
f80e7c0cff97a1e9b301aa04015db983c7645778
[ "BSD-3-Clause" ]
7
2015-05-21T15:38:29.000Z
2019-10-28T23:39:06.000Z
from __future__ import absolute_import from datetime import timedelta from mock import Mock, patch from celery import current_app from celery import states from celery.result import AsyncResult from celery.registry import tasks from celery.task import subtask from celery.utils import cached_property, uuid from celer...
27.228916
75
0.618363
from __future__ import absolute_import from datetime import timedelta from mock import Mock, patch from celery import current_app from celery import states from celery.result import AsyncResult from celery.registry import tasks from celery.task import subtask from celery.utils import cached_property, uuid from celer...
true
true
f75239bbb9042e06a08f858367361d09b0ad2c7e
10,987
py
Python
formulas/bernoulli_numbers.py
pascalmolin/fungrim
f498ad76a385fe7a3b932a314747b7aa2ff475da
[ "MIT" ]
null
null
null
formulas/bernoulli_numbers.py
pascalmolin/fungrim
f498ad76a385fe7a3b932a314747b7aa2ff475da
[ "MIT" ]
null
null
null
formulas/bernoulli_numbers.py
pascalmolin/fungrim
f498ad76a385fe7a3b932a314747b7aa2ff475da
[ "MIT" ]
null
null
null
from .expr import * def_Topic( Title("Bernoulli numbers and polynomials"), Entries( "ac8eca", "1f88a4", ), Section("Tables"), Entries( "aed6bd", "588889", ), Section("Generating functions"), Entries( "522b04", "f79ff0", ), Section(...
38.017301
143
0.637481
from .expr import * def_Topic( Title("Bernoulli numbers and polynomials"), Entries( "ac8eca", "1f88a4", ), Section("Tables"), Entries( "aed6bd", "588889", ), Section("Generating functions"), Entries( "522b04", "f79ff0", ), Section(...
true
true
f7523a4366ca9e2c5e3f2447724af7cc16582bb8
266
py
Python
l5kit/l5kit/configs/config.py
xiaoxiaoheimei/l5kit
1ea2f8cecfe7ad974419bf5c8519ab3a21300119
[ "Apache-2.0" ]
5
2021-02-27T07:40:41.000Z
2022-03-24T07:03:35.000Z
l5kit/l5kit/configs/config.py
phalanx-hk/l5kit
92c88c4050b946b6828a47ddb3d13da9d87f9f7d
[ "Apache-2.0" ]
1
2021-02-23T18:55:05.000Z
2021-02-23T18:55:05.000Z
l5kit/l5kit/configs/config.py
phalanx-hk/l5kit
92c88c4050b946b6828a47ddb3d13da9d87f9f7d
[ "Apache-2.0" ]
2
2021-12-07T06:59:06.000Z
2022-01-22T07:19:18.000Z
import yaml def load_config_data(path: str) -> dict: with open(path) as f: cfg: dict = yaml.load(f, Loader=yaml.FullLoader) return cfg def save_config_data(data: dict, path: str) -> None: with open(path, "w") as f: yaml.dump(data, f)
20.461538
56
0.62782
import yaml def load_config_data(path: str) -> dict: with open(path) as f: cfg: dict = yaml.load(f, Loader=yaml.FullLoader) return cfg def save_config_data(data: dict, path: str) -> None: with open(path, "w") as f: yaml.dump(data, f)
true
true
f7523bdb410594e5a541ca654658d5b34e8c5fcc
811
py
Python
bblfsh_sonar_checks/checks/java/RSPEC-1221.py
juanjux/sonar-checks
65e45ca93bcc59bd20a28f169b00ac4de9b7e98f
[ "Apache-2.0" ]
3
2018-10-02T12:02:37.000Z
2019-04-04T09:18:37.000Z
bblfsh_sonar_checks/checks/java/RSPEC-1221.py
juanjux/sonar-checks
65e45ca93bcc59bd20a28f169b00ac4de9b7e98f
[ "Apache-2.0" ]
6
2018-08-17T14:43:57.000Z
2019-01-08T12:20:03.000Z
bblfsh_sonar_checks/checks/java/RSPEC-1221.py
juanjux/sonar-checks
65e45ca93bcc59bd20a28f169b00ac4de9b7e98f
[ "Apache-2.0" ]
3
2018-08-23T22:35:41.000Z
2020-04-18T11:29:45.000Z
import bblfsh_sonar_checks.utils as utils import bblfsh def check(uast): findings = [] bad_methods = ( ('hashcode', 'int', 'hashCode'), ('tostring', 'String', 'toString'), ('equal', 'boolean', 'equals'), ) for method in utils.get_methods(uast): if "public"...
30.037037
95
0.554871
import bblfsh_sonar_checks.utils as utils import bblfsh def check(uast): findings = [] bad_methods = ( ('hashcode', 'int', 'hashCode'), ('tostring', 'String', 'toString'), ('equal', 'boolean', 'equals'), ) for method in utils.get_methods(uast): if "public"...
true
true
f7523c29d3bab16520a12d7483de118a3d0c08d8
23,793
py
Python
examples/text_summarization/prophetnet/evaluate/gigaword/bs_pyrouge.py
tanhanzhuo/PaddleNLP
d0d20678f2bec820570b4f09ca49cd402d20c3b6
[ "Apache-2.0" ]
1
2022-01-28T06:32:26.000Z
2022-01-28T06:32:26.000Z
examples/text_summarization/prophetnet/evaluate/gigaword/bs_pyrouge.py
tanhanzhuo/PaddleNLP
d0d20678f2bec820570b4f09ca49cd402d20c3b6
[ "Apache-2.0" ]
null
null
null
examples/text_summarization/prophetnet/evaluate/gigaword/bs_pyrouge.py
tanhanzhuo/PaddleNLP
d0d20678f2bec820570b4f09ca49cd402d20c3b6
[ "Apache-2.0" ]
1
2022-03-30T03:05:52.000Z
2022-03-30T03:05:52.000Z
from __future__ import print_function, unicode_literals, division import codecs import logging import os import platform import re from functools import partial from subprocess import check_output from tempfile import mkdtemp try: from configparser import ConfigParser except ImportError: from ConfigParser imp...
36.104704
80
0.58824
from __future__ import print_function, unicode_literals, division import codecs import logging import os import platform import re from functools import partial from subprocess import check_output from tempfile import mkdtemp try: from configparser import ConfigParser except ImportError: from ConfigParser imp...
true
true
f7523d0a6e50bef72051d9b4e2c27753b138a21c
11,353
py
Python
openpype/hosts/nuke/plugins/load/load_mov.py
yosuperdope/OpenPype
0c90df97ddb8cda291a4f66d35da58b3deb94a71
[ "MIT" ]
1
2020-09-21T14:55:33.000Z
2020-09-21T14:55:33.000Z
openpype/hosts/nuke/plugins/load/load_mov.py
jrsndl/pype
f9d80ef2c0663921291c5f47d24bea51fc43bac7
[ "MIT" ]
null
null
null
openpype/hosts/nuke/plugins/load/load_mov.py
jrsndl/pype
f9d80ef2c0663921291c5f47d24bea51fc43bac7
[ "MIT" ]
null
null
null
import nuke from avalon.vendor import qargparse from avalon import api, io from openpype.api import get_current_project_settings from openpype.hosts.nuke.api.lib import ( get_imageio_input_colorspace ) def add_review_presets_config(): returning = { "families": list(), "representations": list()...
32.623563
78
0.554039
import nuke from avalon.vendor import qargparse from avalon import api, io from openpype.api import get_current_project_settings from openpype.hosts.nuke.api.lib import ( get_imageio_input_colorspace ) def add_review_presets_config(): returning = { "families": list(), "representations": list()...
true
true
f7523d4a7a3f1f40228c59c87657989109b2ab32
513
py
Python
fluent_contents/conf/plugin_template/tests.py
jayvdb/django-fluent-contents
dc07f42d80116c1e42efcd0afae91b2843c2e95f
[ "Apache-2.0" ]
82
2016-07-21T08:43:47.000Z
2021-12-21T09:23:42.000Z
fluent_contents/conf/plugin_template/tests.py
jayvdb/django-fluent-contents
dc07f42d80116c1e42efcd0afae91b2843c2e95f
[ "Apache-2.0" ]
47
2015-01-30T22:08:12.000Z
2016-05-30T16:18:17.000Z
fluent_contents/conf/plugin_template/tests.py
jayvdb/django-fluent-contents
dc07f42d80116c1e42efcd0afae91b2843c2e95f
[ "Apache-2.0" ]
17
2016-09-03T05:38:52.000Z
2020-10-04T03:19:16.000Z
from django.test import TestCase from fluent_contents.tests.factories import create_content_item from fluent_contents.tests.utils import render_content_items from .models import {{ model }} class Test{{ plugin }}(TestCase): """ Testing the CMS plugin. """ def test_rendering(self): """ ...
24.428571
63
0.664717
from django.test import TestCase from fluent_contents.tests.factories import create_content_item from fluent_contents.tests.utils import render_content_items from .models import {{ model }} class Test{{ plugin }}(TestCase): """ Testing the CMS plugin. """ def test_rendering(self): """ ...
false
true
f7523d8efe22320a320fad5750b4fc6098469e73
2,627
py
Python
pym/gpio.py
0xcdef/isnano_nmigen
b4c2d0805d14ab259fdb65d1054e188e60e90349
[ "MIT" ]
1
2022-01-10T02:21:40.000Z
2022-01-10T02:21:40.000Z
pym/gpio.py
0xcdef/isnano_nmigen
b4c2d0805d14ab259fdb65d1054e188e60e90349
[ "MIT" ]
null
null
null
pym/gpio.py
0xcdef/isnano_nmigen
b4c2d0805d14ab259fdb65d1054e188e60e90349
[ "MIT" ]
null
null
null
from nmigen import * from nmigen.lib.io import * from nmigen_soc import wishbone from nmigen_soc.memory import MemoryMap __all__ = ["GpioCtrl"] class DummyIO(): def __init__(self, width, name='io'): self.o = Signal(width, name='%s_o'%name) self.i = Signal(width, name='%s_i'%name) self.oe =...
31.650602
97
0.54587
from nmigen import * from nmigen.lib.io import * from nmigen_soc import wishbone from nmigen_soc.memory import MemoryMap __all__ = ["GpioCtrl"] class DummyIO(): def __init__(self, width, name='io'): self.o = Signal(width, name='%s_o'%name) self.i = Signal(width, name='%s_i'%name) self.oe =...
true
true
f7523db70ec4adb25c5980f298c3fa24cf34cd8f
18,941
py
Python
sdk/lusid/models/transaction_request.py
fossabot/lusid-sdk-python
154a0232a00026d79379aec7196555f24d742ade
[ "MIT" ]
null
null
null
sdk/lusid/models/transaction_request.py
fossabot/lusid-sdk-python
154a0232a00026d79379aec7196555f24d742ade
[ "MIT" ]
null
null
null
sdk/lusid/models/transaction_request.py
fossabot/lusid-sdk-python
154a0232a00026d79379aec7196555f24d742ade
[ "MIT" ]
null
null
null
# coding: utf-8 """ LUSID API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.11.2321 Contact: info@finbourne.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class TransactionRequest(object): """NOTE: This cla...
38.110664
412
0.659997
import pprint import re import six class TransactionRequest(object): openapi_types = { 'transaction_id': 'str', 'type': 'str', 'instrument_identifiers': 'dict(str, str)', 'transaction_date': 'str', 'settlement_date': 'str', 'units': 'float', 'transactio...
true
true
f7523dda503f9313f7cae97277e6f99142d44db5
3,496
py
Python
python/cudf_kafka/setup.py
sperlingxx/cudf
c681211df6253e1ceee9203658108980e7e93e3c
[ "Apache-2.0" ]
1
2021-12-17T19:28:00.000Z
2021-12-17T19:28:00.000Z
python/cudf_kafka/setup.py
sperlingxx/cudf
c681211df6253e1ceee9203658108980e7e93e3c
[ "Apache-2.0" ]
1
2021-03-10T20:28:23.000Z
2021-03-25T15:58:47.000Z
python/cudf_kafka/setup.py
sperlingxx/cudf
c681211df6253e1ceee9203658108980e7e93e3c
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2020, NVIDIA CORPORATION. import os import shutil import sysconfig from distutils.sysconfig import get_python_lib import numpy as np from Cython.Build import cythonize from setuptools import find_packages, setup from setuptools.extension import Extension import versioneer install_requires = ["cudf", ...
30.666667
78
0.621568
import os import shutil import sysconfig from distutils.sysconfig import get_python_lib import numpy as np from Cython.Build import cythonize from setuptools import find_packages, setup from setuptools.extension import Extension import versioneer install_requires = ["cudf", "cython"] cython_files = ["cudf_kafka/_li...
true
true
f7523df6e4f2bb97e7b4d204c037edd60fe5a1b9
473
py
Python
topnotchdev/files_widget/templatetags/files_widget_tags.py
redwerk/django-files-widget
9336b90d488e0919856206eb0fc813338a3e66cd
[ "MIT" ]
1
2016-06-21T10:06:53.000Z
2016-06-21T10:06:53.000Z
topnotchdev/files_widget/templatetags/files_widget_tags.py
redwerk/django-files-widget
9336b90d488e0919856206eb0fc813338a3e66cd
[ "MIT" ]
null
null
null
topnotchdev/files_widget/templatetags/files_widget_tags.py
redwerk/django-files-widget
9336b90d488e0919856206eb0fc813338a3e66cd
[ "MIT" ]
null
null
null
import re import urllib from django import template register = template.Library() @register.filter def thumbnail_format(path): match = re.search(r'\.\w+$', path) if match: ext = match.group(0) if ext.lower() in ['.gif', '.png']: return 'PNG' return 'JPEG' @register.filter de...
18.192308
43
0.630021
import re import urllib from django import template register = template.Library() @register.filter def thumbnail_format(path): match = re.search(r'\.\w+$', path) if match: ext = match.group(0) if ext.lower() in ['.gif', '.png']: return 'PNG' return 'JPEG' @register.filter de...
true
true
f7523e56d6e356ca9d8a2f92bd0dd8373e58c140
1,009
py
Python
src/paper/migrations/0064_featuredpaper.py
ResearchHub/ResearchHub-Backend-Open
d36dca33afae2d442690694bb2ab17180d84bcd3
[ "MIT" ]
18
2021-05-20T13:20:16.000Z
2022-02-11T02:40:18.000Z
src/paper/migrations/0064_featuredpaper.py
ResearchHub/ResearchHub-Backend-Open
d36dca33afae2d442690694bb2ab17180d84bcd3
[ "MIT" ]
109
2021-05-21T20:14:23.000Z
2022-03-31T20:56:10.000Z
src/paper/migrations/0064_featuredpaper.py
ResearchHub/ResearchHub-Backend-Open
d36dca33afae2d442690694bb2ab17180d84bcd3
[ "MIT" ]
4
2021-05-17T13:47:53.000Z
2022-02-12T10:48:21.000Z
# Generated by Django 2.2 on 2020-10-12 22:50 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('paper', '0063_paper_paper_...
37.37037
150
0.652131
from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('paper', '0063_paper_paper_type'), ] operations = [ migr...
true
true
f7523eb3304a0053bd73ac2c4136a12b0bbc7553
1,420
py
Python
MachineLearning/feature-extract.py
yuansun1990/master-thesis-source-code
e2bc0f078d51751ac5a0d215821e7f277de9d306
[ "Apache-2.0" ]
2
2016-08-31T12:34:34.000Z
2016-09-12T23:49:57.000Z
MachineLearning/feature-extract.py
yuansun1990/master-thesis-source-code
e2bc0f078d51751ac5a0d215821e7f277de9d306
[ "Apache-2.0" ]
null
null
null
MachineLearning/feature-extract.py
yuansun1990/master-thesis-source-code
e2bc0f078d51751ac5a0d215821e7f277de9d306
[ "Apache-2.0" ]
null
null
null
import sys import nltk import string, re import csv, pandas import numpy """feature-extract.py: extract data with a features list""" __author__ = "YuanSun" # main def main(feature_list_file, input_file, output_file): df_feature = pandas.read_csv(feature_list_file) feature_list = df_feature.values[:,0] fea...
28.979592
86
0.634507
import sys import nltk import string, re import csv, pandas import numpy """feature-extract.py: extract data with a features list""" __author__ = "YuanSun" def main(feature_list_file, input_file, output_file): df_feature = pandas.read_csv(feature_list_file) feature_list = df_feature.values[:,0] feature_li...
false
true
f7523f042d4876f573ac844b0f4d8d93478daef2
7,537
py
Python
src/comp_parser.py
Oliv4945/openschc
175b8b5736bd3c91251366cc02849a8f0255627a
[ "MIT" ]
null
null
null
src/comp_parser.py
Oliv4945/openschc
175b8b5736bd3c91251366cc02849a8f0255627a
[ "MIT" ]
null
null
null
src/comp_parser.py
Oliv4945/openschc
175b8b5736bd3c91251366cc02849a8f0255627a
[ "MIT" ]
null
null
null
""" comp_parser.py transforms a packet dump into a dictionnary. Dictionnary format is the following: { ("field ID", position) : [value, field length in bits, fixed or variable ] } since field ID can be repeated, the index is the tuple field ID and position. """ from base_import import * from schccomp import * # for c...
40.304813
133
0.543187
from base_import import * from schccomp import * from binascii import hexlify, unhexlify from struct import pack, unpack option_names = { 1: T_COAP_OPT_IF_MATCH, 3: T_COAP_OPT_URI_HOST, 4: T_COAP_OPT_ETAG, 5: T_COAP_OPT_IF_NONE_MATCH, 6: T_COAP_OPT_OBS, 7: T_COAP_OPT_URI_PORT, 8: T_COAP_O...
true
true
f7523f72625ea074e6626e4424a07e22b7f86c70
1,626
py
Python
scrapy/tests/test_spidermiddleware_offsite.py
ghrhomeDist/scrapy
0f00b1602a534ec40e89b3e37513930f8050d18b
[ "BSD-3-Clause" ]
1
2015-04-01T20:02:08.000Z
2015-04-01T20:02:08.000Z
scrapy/tests/test_spidermiddleware_offsite.py
raiakash/scrapy
80bb9fb5d2bb1b7a7988383d4e969ca331df655f
[ "BSD-3-Clause" ]
2
2021-12-13T20:51:32.000Z
2022-02-11T03:47:35.000Z
scrapy/tests/test_spidermiddleware_offsite.py
raiakash/scrapy
80bb9fb5d2bb1b7a7988383d4e969ca331df655f
[ "BSD-3-Clause" ]
1
2017-11-09T20:33:59.000Z
2017-11-09T20:33:59.000Z
from unittest import TestCase from scrapy.http import Response, Request from scrapy.spider import BaseSpider from scrapy.contrib.spidermiddleware.offsite import OffsiteMiddleware class TestOffsiteMiddleware(TestCase): def setUp(self): self.spider = self._get_spider() self.mw = OffsiteMiddleware(...
33.183673
82
0.656212
from unittest import TestCase from scrapy.http import Response, Request from scrapy.spider import BaseSpider from scrapy.contrib.spidermiddleware.offsite import OffsiteMiddleware class TestOffsiteMiddleware(TestCase): def setUp(self): self.spider = self._get_spider() self.mw = OffsiteMiddleware(...
true
true
f7523f820a74d5206d0ebb83851d36f903c12735
423
py
Python
opensky/config.py
eclipseespilce/opensky-api
c81b9840309d583471270a1d72ed1d468600d565
[ "MIT" ]
null
null
null
opensky/config.py
eclipseespilce/opensky-api
c81b9840309d583471270a1d72ed1d468600d565
[ "MIT" ]
1
2021-06-02T00:24:19.000Z
2021-06-02T00:24:19.000Z
opensky/config.py
eclipseespilce/opensky-api
c81b9840309d583471270a1d72ed1d468600d565
[ "MIT" ]
null
null
null
import os class Config: OPEN_SKY_START_POINT_LONGITUDE = float(os.environ.get('OPEN_SKY_MIDDLE_POINT_LONGITUDE', 13.41053)) OPEN_SKY_START_POINT_LATITUDE = float(os.environ.get('OPEN_SKY_MIDDLE_POINT_LATITUDE', 52.52437)) OPEN_SKY_FLY_DISTANCE_FROM_START_POINT = int(os.environ.get('OPEN_SKY_FLY_DISTANCE_F...
47
111
0.808511
import os class Config: OPEN_SKY_START_POINT_LONGITUDE = float(os.environ.get('OPEN_SKY_MIDDLE_POINT_LONGITUDE', 13.41053)) OPEN_SKY_START_POINT_LATITUDE = float(os.environ.get('OPEN_SKY_MIDDLE_POINT_LATITUDE', 52.52437)) OPEN_SKY_FLY_DISTANCE_FROM_START_POINT = int(os.environ.get('OPEN_SKY_FLY_DISTANCE_F...
true
true
f7524024ab0763b29f227e599acb998734a1f507
1,631
py
Python
study-drills/sdex29.py
dark-teal-coder/book-learn-python-the-hard-way
e63abddde8c29dcb1c24d8a98116a78b05be67eb
[ "MIT" ]
null
null
null
study-drills/sdex29.py
dark-teal-coder/book-learn-python-the-hard-way
e63abddde8c29dcb1c24d8a98116a78b05be67eb
[ "MIT" ]
null
null
null
study-drills/sdex29.py
dark-teal-coder/book-learn-python-the-hard-way
e63abddde8c29dcb1c24d8a98116a78b05be67eb
[ "MIT" ]
null
null
null
# Study Drills 29 # In this Study Drill, try to guess what you think the if-statement is and what it does. # Try to answer these questions in your own words before moving on to the next exercise: # 1. What do you think the if does to the code under it? # 2. Why does the code under the if need to be indented four spac...
29.654545
99
0.692826
# 4. Can you put other Boolean expressions from Exercise 27 in the if-statement? Try it. # 5. What happens if you change the initial values for people, cats, and dogs? people = 20 cats = 30 dogs = 15 if people < cats: # if True: print("Too many cats! The world is doomed!") if people > cats: # if False: pri...
true
true
f7524141b33dfed07bd0ce7f8d82a0fa05400cda
272
py
Python
lectures/admin.py
CASDON-MYSTERY/studentapp
0fd942e963a10a02a6c9f358dd362cfd646eecc3
[ "MIT" ]
null
null
null
lectures/admin.py
CASDON-MYSTERY/studentapp
0fd942e963a10a02a6c9f358dd362cfd646eecc3
[ "MIT" ]
null
null
null
lectures/admin.py
CASDON-MYSTERY/studentapp
0fd942e963a10a02a6c9f358dd362cfd646eecc3
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Day, Lecture_day_and_venue, Lecture,Recommended_text # Register your models here. admin.site.register(Day) admin.site.register(Lecture_day_and_venue) admin.site.register(Lecture) admin.site.register(Recommended_text)
30.222222
72
0.838235
from django.contrib import admin from .models import Day, Lecture_day_and_venue, Lecture,Recommended_text admin.site.register(Day) admin.site.register(Lecture_day_and_venue) admin.site.register(Lecture) admin.site.register(Recommended_text)
true
true
f7524189ea21dcec995c6ed3106f7fd87c5524df
441
py
Python
mundo-3/ex090.py
GustavoMendel/curso-python
2270734cc159cf44cf513184f1467a9040a7bc46
[ "MIT" ]
null
null
null
mundo-3/ex090.py
GustavoMendel/curso-python
2270734cc159cf44cf513184f1467a9040a7bc46
[ "MIT" ]
null
null
null
mundo-3/ex090.py
GustavoMendel/curso-python
2270734cc159cf44cf513184f1467a9040a7bc46
[ "MIT" ]
null
null
null
print(f'\033[1:33m{"-"*40:^40}\033[m') print(f'\033[1:33m{"DICIONÁRIO EM PYTHON":^40}\033[m') print(f'\033[1:33m{"-"*40:^40}\033[m') aluno = dict() aluno['Nome'] = str(input('Nome: ')) aluno['Média'] = float(input(f'Média de {aluno["Nome"]}: ')) if aluno['Média'] >= 7: aluno['Situação'] = '\033[1:32mAprovado\033[...
27.5625
60
0.589569
print(f'\033[1:33m{"-"*40:^40}\033[m') print(f'\033[1:33m{"DICIONÁRIO EM PYTHON":^40}\033[m') print(f'\033[1:33m{"-"*40:^40}\033[m') aluno = dict() aluno['Nome'] = str(input('Nome: ')) aluno['Média'] = float(input(f'Média de {aluno["Nome"]}: ')) if aluno['Média'] >= 7: aluno['Situação'] = '\033[1:32mAprovado\033[...
true
true
f75242eb885b2f24aed4be33ad92a9cadbe54049
6,403
py
Python
Graph_MPPT.py
awardblvr/pv_mppt_test
366015fd418448791b8470baf82e6ecb3686b17d
[ "MIT" ]
null
null
null
Graph_MPPT.py
awardblvr/pv_mppt_test
366015fd418448791b8470baf82e6ecb3686b17d
[ "MIT" ]
null
null
null
Graph_MPPT.py
awardblvr/pv_mppt_test
366015fd418448791b8470baf82e6ecb3686b17d
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ Import MPPT CSV data and plot it. CSV format: Volts,volts,amps,watts,state,mode_str,panelSN,resistance,timestamp 29.646,29.646,0.0,0.0,0,CR,B41J00052893,100000,20210913_120014.79 14.267,14.267,0.354,5.05,1,CR,B41J00052893,40.0,20210913_120016.16 """ from __future__ import print_functi...
34.424731
112
0.609246
from __future__ import print_function import os import sys import argparse from datetime import datetime as dt import time import pandas as pd from numpy import * import numpy as np from mpl_toolkits.axes_grid1 import host_subplot from mpl_toolkits import axisartist import matplotlib.pyplot as plt from matplotlib.tic...
true
true
f752438210515ca14677be15e338538aef5d9fb6
4,733
py
Python
flask_app.py
moonsats/paw
2be56c0427e1e37eed7e92e8227c98cd82bd6340
[ "MIT" ]
null
null
null
flask_app.py
moonsats/paw
2be56c0427e1e37eed7e92e8227c98cd82bd6340
[ "MIT" ]
null
null
null
flask_app.py
moonsats/paw
2be56c0427e1e37eed7e92e8227c98cd82bd6340
[ "MIT" ]
null
null
null
# -*- coding=utf-8 -*- """ 주요 기능: - 매매 신호 수신 - 매매 결과 송신 - 사용자 인증 사용례: - """ ##@@@ 모듈 import ##============================================================ ##@@ Built-In 모듈 ##------------------------------------------------------------ import os, sys import requests import time import json import z...
25.722826
107
0.559053
import os, sys import requests import time import json import zlib import base64 import string from flask import Flask, render_template, request conn = pymysql.connect(host='localhost', user='root', password='password', db='developer', charset='utf8') cursor = conn.cursor() sql = '''CREATE TABLE user ...
true
true
f75244dded68ac3d0cf638b463d7be288c5a088b
4,141
py
Python
hw2/main.py
tjjh89017/compiler
0395073c94f9c8c778decd9239397fb265ae9a2a
[ "MIT" ]
null
null
null
hw2/main.py
tjjh89017/compiler
0395073c94f9c8c778decd9239397fb265ae9a2a
[ "MIT" ]
null
null
null
hw2/main.py
tjjh89017/compiler
0395073c94f9c8c778decd9239397fb265ae9a2a
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os def is_nonterminal(s): return s.isupper() def is_terminal(s): return not is_nonterminal(s) and not s == "l" def __calc(F, prod_list): while __iter(F, prod_list): pass def __iter(F, prod_list): change = False for p in prod_list: if __i...
19.350467
87
0.606617
import sys import os def is_nonterminal(s): return s.isupper() def is_terminal(s): return not is_nonterminal(s) and not s == "l" def __calc(F, prod_list): while __iter(F, prod_list): pass def __iter(F, prod_list): change = False for p in prod_list: if __iter_prod(F, p): change = True return change...
true
true
f752451eb6ea412b99310d59eba01f2edb50a654
737
py
Python
i_server.py
JakeMakesStuff/aurorame.me
1fec7516eb05dfb58759f914ec29a2312ac7eeab
[ "Apache-2.0" ]
1
2017-10-07T11:44:09.000Z
2017-10-07T11:44:09.000Z
i_server.py
JakeMakesStuff/aurorame.me
1fec7516eb05dfb58759f914ec29a2312ac7eeab
[ "Apache-2.0" ]
1
2017-10-11T20:05:48.000Z
2017-10-11T20:07:45.000Z
i_server.py
JakeMakesStuff/aurorame.me
1fec7516eb05dfb58759f914ec29a2312ac7eeab
[ "Apache-2.0" ]
null
null
null
import os from flask import Flask, send_file, abort # Imports and stuff. webserver = Flask(__name__) # Defines the web server. @webserver.route("/") def acc_denied(): return "You cannot browse this subdomain." # Denies access if user tries to browse the subdomain. @webserver.route("/<path:imageid>") ...
26.321429
61
0.616011
import os from flask import Flask, send_file, abort webserver = Flask(__name__) @webserver.route("/") def acc_denied(): return "You cannot browse this subdomain." @webserver.route("/<path:imageid>") def i(imageid): imageid = imageid.rstrip('/').split('.')[0] x = False for file in os.list...
true
true
f7524534f5ae6a616c25eb35bccbc40aa3c509d7
525
py
Python
tslearn/early_classification/__init__.py
andriyor/tslearn
6c93071b385a89112b82799ae5870daeca1ab88b
[ "BSD-2-Clause" ]
1,151
2020-04-30T08:24:14.000Z
2022-03-29T22:12:01.000Z
tslearn/early_classification/__init__.py
andriyor/tslearn
6c93071b385a89112b82799ae5870daeca1ab88b
[ "BSD-2-Clause" ]
216
2017-05-10T23:33:10.000Z
2020-04-30T07:28:26.000Z
tslearn/early_classification/__init__.py
andriyor/tslearn
6c93071b385a89112b82799ae5870daeca1ab88b
[ "BSD-2-Clause" ]
172
2017-06-02T11:53:50.000Z
2020-04-22T15:29:13.000Z
""" The :mod:`tslearn.early_classification` module gathers early classifiers for time series. Such classifiers aim at performing prediction as early as possible (i.e. they do not necessarily wait for the end of the series before prediction is triggered). **User guide:** See the :ref:`Early Classification <early>` sec...
26.25
80
0.779048
from .early_classification import NonMyopicEarlyClassifier __author__ = 'Romain Tavenard romain.tavenard[at]univ-rennes2.fr' __all__ = [ "NonMyopicEarlyClassifier" ]
true
true
f752457df0bd516ac54e1f08100e80d605efd56c
52,355
py
Python
py_insightvm_sdk/models/host_name.py
greenpau/py_insightvm_sdk
bd881f26e14cb9f0f9c47927469ec992de9de8e6
[ "Apache-2.0" ]
2
2019-03-15T16:05:54.000Z
2020-07-19T18:37:50.000Z
py_insightvm_sdk/models/host_name.py
greenpau/py_insightvm_sdk
bd881f26e14cb9f0f9c47927469ec992de9de8e6
[ "Apache-2.0" ]
1
2021-03-26T04:46:12.000Z
2021-03-26T04:51:23.000Z
py_insightvm_sdk/models/host_name.py
greenpau/py_insightvm_sdk
bd881f26e14cb9f0f9c47927469ec992de9de8e6
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ InsightVM API # Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ...
342.189542
48,045
0.491548
import pprint import re import six class HostName(object): swagger_types = { 'name': 'str', 'source': 'str' } attribute_map = { 'name': 'name', 'source': 'source' } def __init__(self, name=None, source=None): self._name = None self._source ...
true
true
f75245ee3cec8e15d5d762559823f11139e21708
1,530
py
Python
IK_LexicographicalOrder.py
amukher3/Problem_solutions
8fa6014a91f295d08cafb989024caa91d99211d9
[ "Apache-2.0" ]
1
2021-12-28T08:58:51.000Z
2021-12-28T08:58:51.000Z
IK_LexicographicalOrder.py
amukher3/Coding
a330cb04b5dd5cc1c3cf69249417a71586441bc7
[ "Apache-2.0" ]
null
null
null
IK_LexicographicalOrder.py
amukher3/Coding
a330cb04b5dd5cc1c3cf69249417a71586441bc7
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Thu Jan 2 15:18:12 2020 @author: Abhishek Mukherjee """ #Lexicographic order # N can be 10^5 #So, time complexity might matter!! #Not in linear time. # # Complete the solve function below. # def solve(arr): Words=list() for i in range(len(arr)): ...
23.90625
75
0.545752
def solve(arr): Words=list() for i in range(len(arr)): Words.append(arr[i].split()) SortedWords=[] from operator import itemgetter SortedWords=sorted(Words,key=itemgetter(0)) Vals=[] Keys=[] for i in range(len(Words)): Vals.appen...
true
true
f75247f1ab160b3f92811429178b7fca80b2c9e6
1,663
py
Python
examples/singleobjective/generational_genetic_algorithm_tsp.py
NatalieGvozdetska/jMetalPy
ab791b25ba025ccfde4f6be36b6fae254ece48ad
[ "MIT" ]
null
null
null
examples/singleobjective/generational_genetic_algorithm_tsp.py
NatalieGvozdetska/jMetalPy
ab791b25ba025ccfde4f6be36b6fae254ece48ad
[ "MIT" ]
null
null
null
examples/singleobjective/generational_genetic_algorithm_tsp.py
NatalieGvozdetska/jMetalPy
ab791b25ba025ccfde4f6be36b6fae254ece48ad
[ "MIT" ]
null
null
null
from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm from jmetal.operator import BinaryTournamentSelection from jmetal.operator.crossover import PMXCrossover from jmetal.operator.mutation import PermutationSwapMutation from jmetal.problem.singleobjective.tsp import TSP from jmetal.util.densit...
42.641026
79
0.761876
from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm from jmetal.operator import BinaryTournamentSelection from jmetal.operator.crossover import PMXCrossover from jmetal.operator.mutation import PermutationSwapMutation from jmetal.problem.singleobjective.tsp import TSP from jmetal.util.densit...
true
true
f7524808fc4977879bbd3fdfbed7b44365ec0bbc
41,242
py
Python
test/ext/test_hybrid.py
immerrr/sqlalchemy
995fb577a64061a9cbab62b481c65a4c4d3e5a67
[ "MIT" ]
1
2021-12-11T19:03:57.000Z
2021-12-11T19:03:57.000Z
test/ext/test_hybrid.py
taogeYT/sqlalchemy
e88dc004e6bcd1418cb8eb811d0aa580c2a44b8f
[ "MIT" ]
null
null
null
test/ext/test_hybrid.py
taogeYT/sqlalchemy
e88dc004e6bcd1418cb8eb811d0aa580c2a44b8f
[ "MIT" ]
null
null
null
from decimal import Decimal from sqlalchemy import exc from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import LABEL_STYLE_TABLENAME_PLUS_COL from sqlalchemy import literal_column from sqlalchemy import Numeric from sqlalchemy i...
30.325
79
0.562727
from decimal import Decimal from sqlalchemy import exc from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import LABEL_STYLE_TABLENAME_PLUS_COL from sqlalchemy import literal_column from sqlalchemy import Numeric from sqlalchemy i...
true
true
f75248739f38bd8c6aabb26158772f74f33a7dab
16,820
py
Python
pyxfoil.py
jberkman/pyxfoil
511cb0e2cdc7e2967bc53fa0276351ebf57a90bf
[ "MIT" ]
null
null
null
pyxfoil.py
jberkman/pyxfoil
511cb0e2cdc7e2967bc53fa0276351ebf57a90bf
[ "MIT" ]
null
null
null
pyxfoil.py
jberkman/pyxfoil
511cb0e2cdc7e2967bc53fa0276351ebf57a90bf
[ "MIT" ]
null
null
null
"""PYXFOIL: XFOIL AUTOMATION USING PYTHON Logan Halstrom EAE 127 UCD CREATED: 15 SEP 2015 MODIFIED: 17 OCT 2018 DESCRIPTION: Provides functions for automating XFOIL runs. Each function will iteratively build a list of inputs. When you are ready, use the RunXfoil command to run the input list NOTE: Since input list i...
34.968815
88
0.571165
import os import sys import re import numpy as np import subprocess import pandas as pd def MakeOutputDir(savedir): splitstring = savedir.split('/') prestring = '' for string in splitstring: prestring += string + '/' try: os.mkdir(prestring) except Exception: ...
true
true
f75248a5343c678f9b559aa1284b5037beb3d826
5,524
py
Python
padertorch/contrib/je/data/mixup.py
michael-kuhlmann/padertorch
3925fa693299ffb166d82dd81deed997237e85c7
[ "MIT" ]
null
null
null
padertorch/contrib/je/data/mixup.py
michael-kuhlmann/padertorch
3925fa693299ffb166d82dd81deed997237e85c7
[ "MIT" ]
null
null
null
padertorch/contrib/je/data/mixup.py
michael-kuhlmann/padertorch
3925fa693299ffb166d82dd81deed997237e85c7
[ "MIT" ]
null
null
null
from lazy_dataset import Dataset, FilterException import numpy as np import numbers class MixUpDataset(Dataset): """ >>> ds = MixUpDataset(range(10), SampleMixupComponents((.0,1.)), (lambda x: x), buffer_size=2) >>> list(ds) """ def __init__(self, input_dataset, sample_fn, mixup_fn, buffer_size=10...
39.741007
188
0.585264
from lazy_dataset import Dataset, FilterException import numpy as np import numbers class MixUpDataset(Dataset): def __init__(self, input_dataset, sample_fn, mixup_fn, buffer_size=100): self.input_dataset = input_dataset self.buffer = [] self.buffer_size = buffer_size self.sample_f...
true
true
f75248eae50c817036fc89b846a69df457874f55
10,346
py
Python
foolscap/appserver/services.py
daira/foolscap
d34838ec99023eabef178110a74ca0c97b69603a
[ "MIT" ]
1
2018-01-22T17:17:32.000Z
2018-01-22T17:17:32.000Z
foolscap/appserver/services.py
daira/foolscap
d34838ec99023eabef178110a74ca0c97b69603a
[ "MIT" ]
null
null
null
foolscap/appserver/services.py
daira/foolscap
d34838ec99023eabef178110a74ca0c97b69603a
[ "MIT" ]
null
null
null
import os from twisted.python import usage, runtime, filepath, log from twisted.application import service from twisted.internet import defer, reactor, protocol from foolscap.api import Referenceable class BadServiceArguments(Exception): pass class UnknownServiceType(Exception): pass class BaseOptions(usage....
34.952703
89
0.616953
import os from twisted.python import usage, runtime, filepath, log from twisted.application import service from twisted.internet import defer, reactor, protocol from foolscap.api import Referenceable class BadServiceArguments(Exception): pass class UnknownServiceType(Exception): pass class BaseOptions(usage....
false
true
f752493a98b105563dfee6f50345d417b5066e15
511
py
Python
djangocms_personalisation/migrations/0003_personalisationredirectpluginmodel_delay.py
divio/djangocms-personalisation
15f52e0911da884c3d96ec3e634dee3c47325f0c
[ "BSD-3-Clause" ]
1
2019-09-07T21:39:39.000Z
2019-09-07T21:39:39.000Z
djangocms_personalisation/migrations/0003_personalisationredirectpluginmodel_delay.py
divio/djangocms-personalisation
15f52e0911da884c3d96ec3e634dee3c47325f0c
[ "BSD-3-Clause" ]
null
null
null
djangocms_personalisation/migrations/0003_personalisationredirectpluginmodel_delay.py
divio/djangocms-personalisation
15f52e0911da884c3d96ec3e634dee3c47325f0c
[ "BSD-3-Clause" ]
1
2021-08-20T21:16:38.000Z
2021-08-20T21:16:38.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djangocms_personalisation', '0002_personalisationredirectpluginmodel'), ] operations = [ migrations.AddField( mo...
25.55
100
0.675147
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djangocms_personalisation', '0002_personalisationredirectpluginmodel'), ] operations = [ migrations.AddField( model_name='personalisatio...
true
true
f75249eb83097caa826c7273fbac1b310e4c7c46
6,927
py
Python
experiments/graph_coloring/datasets/graph_coloring_generation.py
achinta/CategoricalNF
d8717a037e8f13641e9d9a89abf66fba38e23f91
[ "MIT" ]
47
2020-06-20T10:00:39.000Z
2022-03-08T13:41:45.000Z
experiments/graph_coloring/datasets/graph_coloring_generation.py
achinta/CategoricalNF
d8717a037e8f13641e9d9a89abf66fba38e23f91
[ "MIT" ]
1
2020-07-05T20:58:19.000Z
2020-09-08T12:45:29.000Z
experiments/graph_coloring/datasets/graph_coloring_generation.py
achinta/CategoricalNF
d8717a037e8f13641e9d9a89abf66fba38e23f91
[ "MIT" ]
10
2020-07-05T17:18:40.000Z
2022-01-07T03:17:40.000Z
import random import numpy as np import networkx as nx import sys, os, json, argparse, itertools import grinpy as gp import time from glob import glob from multiprocessing import Pool from ortools.sat.python import cp_model """ This code is based on https://github.com/machine-reasoning-ufrgs/GNN-GCP """ def solve_cs...
33.143541
132
0.691208
import random import numpy as np import networkx as nx import sys, os, json, argparse, itertools import grinpy as gp import time from glob import glob from multiprocessing import Pool from ortools.sat.python import cp_model def solve_csp(M, n_colors, nmin=25): model = cp_model.CpModel() N = len(M) variables = ...
true
true
f7524ac2efe5d5bd84980ed7698b0504e9ba2d60
3,490
py
Python
meiduo_mall/meiduo_mall/apps/verifications/views.py
Nicholas-violet/meiduo_project_formal
7ef674f4208e496ec1a5474e68672dbd1c2c077b
[ "MIT" ]
null
null
null
meiduo_mall/meiduo_mall/apps/verifications/views.py
Nicholas-violet/meiduo_project_formal
7ef674f4208e496ec1a5474e68672dbd1c2c077b
[ "MIT" ]
null
null
null
meiduo_mall/meiduo_mall/apps/verifications/views.py
Nicholas-violet/meiduo_project_formal
7ef674f4208e496ec1a5474e68672dbd1c2c077b
[ "MIT" ]
null
null
null
from django.shortcuts import render # Create your views here. import logging logger = logging.getLogger('django') from django import http import random from django.views import View from django_redis import get_redis_connection from meiduo_mall.libs.captcha.captcha import captcha # from meiduo_mall.libs.yuntongxun.ccp...
26.846154
66
0.575358
from django.shortcuts import render import logging logger = logging.getLogger('django') from django import http import random from django.views import View from django_redis import get_redis_connection from meiduo_mall.libs.captcha.captcha import captcha from celery_tasks.sms.tasks import ccp_send_sms_code class Ima...
true
true
f7524bd5adc827f8051fe91de74d42c4a8812379
736
py
Python
examples/01-basic/03-switch-evaluation/test_switch.py
fragmuffin/upytester
09b213ddcadff27ab72715024a3500a3569640ef
[ "MIT" ]
4
2019-02-04T04:47:20.000Z
2021-12-08T02:37:08.000Z
examples/01-basic/03-switch-evaluation/test_switch.py
fragmuffin/upytester
09b213ddcadff27ab72715024a3500a3569640ef
[ "MIT" ]
2
2019-04-22T22:09:24.000Z
2020-09-08T04:46:38.000Z
examples/01-basic/03-switch-evaluation/test_switch.py
fragmuffin/upytester
09b213ddcadff27ab72715024a3500a3569640ef
[ "MIT" ]
null
null
null
import time import unittest import upytester # ------------ Bench Environment ------------ class Switch(object): def __init__(self, device): self.device = device @property def value(self): return self.device.get_switch()()['value'] class BenchTest(unittest.TestCase): @classmethod ...
21.028571
57
0.605978
import time import unittest import upytester class Switch(object): def __init__(self, device): self.device = device @property def value(self): return self.device.get_switch()()['value'] class BenchTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.pyb_a = upy...
true
true
f7524c4870b0ef2d80d50df5dbb50c2449df6db2
1,625
py
Python
kaori/plugins/gacha/engine/test/card_simulator.py
austinpray/kaori
b21c4146b9d0d27b87015cff0768138568a12e9c
[ "MIT" ]
3
2020-05-04T03:43:20.000Z
2020-12-03T22:34:47.000Z
kaori/plugins/gacha/engine/test/card_simulator.py
austinpray/kaori
b21c4146b9d0d27b87015cff0768138568a12e9c
[ "MIT" ]
287
2020-04-21T02:39:47.000Z
2022-03-28T13:11:59.000Z
kaori/plugins/gacha/engine/test/card_simulator.py
austinpray/kaori
b21c4146b9d0d27b87015cff0768138568a12e9c
[ "MIT" ]
1
2020-10-22T00:20:43.000Z
2020-10-22T00:20:43.000Z
from io import StringIO import arrow import mdv from .cards import * from .utils import collect_cards, card_markdown from .. import * from ..utils import trim_doc def run_card_simulator(raw=False): card_groups = { 'Baselines': [ hp_no_invest, dmg_no_invest, ], 'HP...
24.621212
101
0.564308
from io import StringIO import arrow import mdv from .cards import * from .utils import collect_cards, card_markdown from .. import * from ..utils import trim_doc def run_card_simulator(raw=False): card_groups = { 'Baselines': [ hp_no_invest, dmg_no_invest, ], 'HP...
true
true
f7524cf05103b818a674e6a733553cc6b778a72d
1,782
py
Python
rgw/v2/lib/pem.py
rpratap-bot/ceph-qe-scripts
8a7090d6707a8e7b927eabfc9c9212f343a35bc4
[ "MIT" ]
null
null
null
rgw/v2/lib/pem.py
rpratap-bot/ceph-qe-scripts
8a7090d6707a8e7b927eabfc9c9212f343a35bc4
[ "MIT" ]
null
null
null
rgw/v2/lib/pem.py
rpratap-bot/ceph-qe-scripts
8a7090d6707a8e7b927eabfc9c9212f343a35bc4
[ "MIT" ]
null
null
null
import os import sys sys.path.append(os.path.abspath(os.path.join(__file__, "../../../"))) import v2.utils.utils as utils import traceback SSL_CERT_PATH = '/etc/ssl/certs/' PEM_FILE_NAME = 'server.pem' PEM_FILE_PATH = os.path.join(SSL_CERT_PATH, PEM_FILE_NAME) import logging log = loggi...
30.724138
105
0.597643
import os import sys sys.path.append(os.path.abspath(os.path.join(__file__, "../../../"))) import v2.utils.utils as utils import traceback SSL_CERT_PATH = '/etc/ssl/certs/' PEM_FILE_NAME = 'server.pem' PEM_FILE_PATH = os.path.join(SSL_CERT_PATH, PEM_FILE_NAME) import logging log = loggi...
true
true
f7524d6b06d00fef03cb770ff38ecfd1a64170a3
699
py
Python
tests/test_single_version.py
shadeofblue/single-version
158ee876a2498cdd964fb2a5109ca93629744fa7
[ "MIT" ]
null
null
null
tests/test_single_version.py
shadeofblue/single-version
158ee876a2498cdd964fb2a5109ca93629744fa7
[ "MIT" ]
null
null
null
tests/test_single_version.py
shadeofblue/single-version
158ee876a2498cdd964fb2a5109ca93629744fa7
[ "MIT" ]
null
null
null
from single_version import __version__ from single_version.ver import _REGEX_VERSION def test_version(): assert __version__ == '1.2.2' def test_version_regex(): assert _REGEX_VERSION.match('version="1.2"') def test_version_regex_with_prefix(): assert _REGEX_VERSION.match('version="v1.2"') def test_v...
22.548387
60
0.756795
from single_version import __version__ from single_version.ver import _REGEX_VERSION def test_version(): assert __version__ == '1.2.2' def test_version_regex(): assert _REGEX_VERSION.match('version="1.2"') def test_version_regex_with_prefix(): assert _REGEX_VERSION.match('version="v1.2"') def test_v...
true
true
f7524ee7689a69ff9bf54d4f509e06b545f76709
1,346
py
Python
2018/day24/test_day24.py
kfarnung/advent-of-code
74604578379c518bd7ad959e0088ca55a6986515
[ "MIT" ]
1
2017-12-11T07:08:52.000Z
2017-12-11T07:08:52.000Z
2018/day24/test_day24.py
kfarnung/advent-of-code
74604578379c518bd7ad959e0088ca55a6986515
[ "MIT" ]
2
2020-12-01T08:16:42.000Z
2021-05-12T04:54:34.000Z
2018/day24/test_day24.py
kfarnung/advent-of-code
74604578379c518bd7ad959e0088ca55a6986515
[ "MIT" ]
null
null
null
""" Tests for Advent of Code Day 24. https://adventofcode.com/2018/day/24 """ from os import path from .day24 import run_part1, run_part2 _CURRENT_FILE_DIR = path.dirname(__file__) _TEST_DATA = [ 'Immune System:', '17 units each with 5390 hit points (weak to radiation, bludgeoning) with an attack that does '...
32.047619
100
0.690193
from os import path from .day24 import run_part1, run_part2 _CURRENT_FILE_DIR = path.dirname(__file__) _TEST_DATA = [ 'Immune System:', '17 units each with 5390 hit points (weak to radiation, bludgeoning) with an attack that does ' '4507 fire damage at initiative 2', '989 units each with 1274 hit poin...
true
true
f7524f52f6d4abaa49ac183133af0ba7c9436807
7,149
py
Python
tst/schedulers/test_hyperband.py
awslabs/syne-tune
1dd8e157477b86db01047a9a7821780ea04389bc
[ "ECL-2.0", "Apache-2.0" ]
97
2021-11-18T17:14:30.000Z
2022-03-29T00:33:12.000Z
tst/schedulers/test_hyperband.py
awslabs/syne-tune
1dd8e157477b86db01047a9a7821780ea04389bc
[ "ECL-2.0", "Apache-2.0" ]
54
2021-11-18T17:14:12.000Z
2022-03-22T08:11:48.000Z
tst/schedulers/test_hyperband.py
awslabs/syne-tune
1dd8e157477b86db01047a9a7821780ea04389bc
[ "ECL-2.0", "Apache-2.0" ]
9
2021-11-29T11:47:32.000Z
2022-02-24T15:28:11.000Z
# Copyright 2021 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
37.234375
88
0.615471
from datetime import datetime from typing import Optional, Dict, Tuple import pytest from syne_tune.optimizer.schedulers.hyperband import HyperbandScheduler from syne_tune.config_space import randint, uniform from syne_tune.backend.trial_status import Trial from syne_tune.optimizer.scheduler import SchedulerDecision f...
true
true
f7525072026b529a7b05bf587945150f1aeb366e
2,779
py
Python
App/Set Tool Shortcuts.py
justanotherfoundry/Glyphs-Scripts
f28aeab0224ae19ace4a86cf363e7990985199b7
[ "Apache-2.0" ]
283
2015-01-07T12:35:35.000Z
2022-03-29T06:10:44.000Z
App/Set Tool Shortcuts.py
justanotherfoundry/Glyphs-Scripts
f28aeab0224ae19ace4a86cf363e7990985199b7
[ "Apache-2.0" ]
203
2015-01-26T18:43:08.000Z
2022-03-04T01:47:58.000Z
App/Set Tool Shortcuts.py
justanotherfoundry/Glyphs-Scripts
f28aeab0224ae19ace4a86cf363e7990985199b7
[ "Apache-2.0" ]
96
2015-01-19T20:58:03.000Z
2022-03-29T06:10:56.000Z
#MenuTitle: Set Tool Shortcuts # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Set Shortcuts for tools in toolbar. """ import vanilla shortcuts = { "AnnotationTool": u"a", "DrawTool": u"p", "HandTool": u"h", "MeasurementTool": u"l", "OtherPathsTool": u"e", "...
31.942529
134
0.663908
from __future__ import division, print_function, unicode_literals __doc__=""" Set Shortcuts for tools in toolbar. """ import vanilla shortcuts = { "AnnotationTool": u"a", "DrawTool": u"p", "HandTool": u"h", "MeasurementTool": u"l", "OtherPathsTool": u"e", "PenTool": u"b", "PrimitivesTool": u"f", "SelectTool":...
true
true
f75252363f061c6d7b391aeddbf0cb5a203d69b0
667
py
Python
example2/simple.py
Shuang0420/python-aiml
c92681a8458bbceb7efb5eab307f0b997c1bf8c8
[ "BSD-2-Clause" ]
73
2018-01-15T14:20:32.000Z
2022-03-30T11:04:42.000Z
example2/simple.py
Shuang0420/python-aiml
c92681a8458bbceb7efb5eab307f0b997c1bf8c8
[ "BSD-2-Clause" ]
null
null
null
example2/simple.py
Shuang0420/python-aiml
c92681a8458bbceb7efb5eab307f0b997c1bf8c8
[ "BSD-2-Clause" ]
32
2018-01-08T11:04:25.000Z
2021-12-31T03:13:45.000Z
import sys sys.path.insert(0, "../") import aiml from aiml.constants import * # The Kernel object is the public interface to # the AIML interpreter. k = aiml.Kernel() # Use the 'learn' method to load the contents # of an AIML file into the Kernel. k.learn("cn-startup.xml") # Use the 'respond' method to compute the...
23
51
0.691154
import sys sys.path.insert(0, "../") import aiml from aiml.constants import * k = aiml.Kernel() k.learn("cn-startup.xml") # the interpreter's response, which in this case k.respond("load aiml cnask") while True: if PY3: print(k.respond(input("> "))) else: print(k.respond(raw_input("> ")))...
true
true
f75252c7a204123e93c0b9ad40729de4aae4a47b
47
py
Python
packages/girder_worker/girder_worker/plugins/types/format/image/png_base64_to_png.py
ShenQianwithC/HistomicsTK
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
[ "Apache-2.0" ]
null
null
null
packages/girder_worker/girder_worker/plugins/types/format/image/png_base64_to_png.py
ShenQianwithC/HistomicsTK
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
[ "Apache-2.0" ]
null
null
null
packages/girder_worker/girder_worker/plugins/types/format/image/png_base64_to_png.py
ShenQianwithC/HistomicsTK
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
[ "Apache-2.0" ]
null
null
null
import base64 output = base64.b64decode(input)
15.666667
32
0.808511
import base64 output = base64.b64decode(input)
true
true
f75253983af5fae34eed957d055589cb30536f13
647
py
Python
kittygram_plus/urls.py
IlushinGL/kittygram_plus
0f4fd41d4b6295c3ecc2b373cfede2c77bd28319
[ "MIT" ]
null
null
null
kittygram_plus/urls.py
IlushinGL/kittygram_plus
0f4fd41d4b6295c3ecc2b373cfede2c77bd28319
[ "MIT" ]
null
null
null
kittygram_plus/urls.py
IlushinGL/kittygram_plus
0f4fd41d4b6295c3ecc2b373cfede2c77bd28319
[ "MIT" ]
null
null
null
from rest_framework.routers import DefaultRouter # from rest_framework.authtoken import views from django.urls import include, path from cats.views import CatViewSet, OwnerViewSet, LightCatViewSet router = DefaultRouter() router.register('cats', CatViewSet) router.register('owners', OwnerViewSet) router.register(r'm...
30.809524
64
0.749614
from rest_framework.routers import DefaultRouter from django.urls import include, path from cats.views import CatViewSet, OwnerViewSet, LightCatViewSet router = DefaultRouter() router.register('cats', CatViewSet) router.register('owners', OwnerViewSet) router.register(r'mycats', LightCatViewSet) urlpatterns = [ ...
true
true
f75253eb431d15c4b026d5342d550db4c0857d31
4,620
py
Python
helpers/bloom.py
ARKseal/crawlingathome-gpu-hcloud
73f185df36eb5e420e6513bcf1b518dd21499b76
[ "MIT" ]
null
null
null
helpers/bloom.py
ARKseal/crawlingathome-gpu-hcloud
73f185df36eb5e420e6513bcf1b518dd21499b76
[ "MIT" ]
null
null
null
helpers/bloom.py
ARKseal/crawlingathome-gpu-hcloud
73f185df36eb5e420e6513bcf1b518dd21499b76
[ "MIT" ]
null
null
null
# use this file inside every minute cron in order to recalculate bloom filters. location: staging server # folder structure # /home/archiveteam/CAH/ # |_bloom archiveteam@IP::bloom contains bloom filters # |_clipped contains clipped lists # ...
46.2
261
0.615152
import sys import time import requests import pandas as pd from glob import glob from pathlib import Path from datetime import datetime from bloom_filter2 import BloomFilter bloomip = "116.202.162.146" serverbloom = BloomFilter(max_elements=10000000, error_rate=0.01, filename=(f"/home/archiveteam/bloom-{bloomip}.bin...
true
true
f75256736d24a39c7c39c048a1c443954662abe3
32
py
Python
python/testData/completion/className/submoduleRegularImport/submoduleRegularImport.after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/completion/className/submoduleRegularImport/submoduleRegularImport.after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/completion/className/submoduleRegularImport/submoduleRegularImport.after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
import pack.submod pack.submod
8
18
0.8125
import pack.submod pack.submod
true
true
f752568f84e1627d0055abbe83d26d9e81eb9e98
5,491
py
Python
examples/applications/plot_tomography_l1_reconstruction.py
ikingye/scikit-learn
3254e98a79e5c1172c794ad38f222dc45f0fb65c
[ "BSD-3-Clause" ]
3
2020-02-28T09:28:09.000Z
2020-10-12T07:09:40.000Z
examples/applications/plot_tomography_l1_reconstruction.py
ikingye/scikit-learn
3254e98a79e5c1172c794ad38f222dc45f0fb65c
[ "BSD-3-Clause" ]
2
2019-07-11T13:48:42.000Z
2020-08-09T18:30:36.000Z
examples/applications/plot_tomography_l1_reconstruction.py
ikingye/scikit-learn
3254e98a79e5c1172c794ad38f222dc45f0fb65c
[ "BSD-3-Clause" ]
1
2021-09-06T08:42:02.000Z
2021-09-06T08:42:02.000Z
""" ====================================================================== Compressive sensing: tomography reconstruction with L1 prior (Lasso) ====================================================================== This example shows the reconstruction of an image from a set of parallel projections, acquired along dif...
36.606667
77
0.692042
print(__doc__) import numpy as np from scipy import sparse from scipy import ndimage from sklearn.linear_model import Lasso from sklearn.linear_model import Ridge import matplotlib.pyplot as plt def _weights(x, dx=1, orig=0): x = np.ravel(x) floor_x = np.floor((x - orig) / dx).astype(np.int64) alpha = ...
true
true
f75256b11cc184fc73b0c941c48e9e3ecb65eae8
4,417
py
Python
conll.py
ChristianHesels/e2e-german
c0410a558ad9f332553518c3b588fd193c9e2bc4
[ "Apache-2.0" ]
null
null
null
conll.py
ChristianHesels/e2e-german
c0410a558ad9f332553518c3b588fd193c9e2bc4
[ "Apache-2.0" ]
null
null
null
conll.py
ChristianHesels/e2e-german
c0410a558ad9f332553518c3b588fd193c9e2bc4
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import os import sys from evaluate.arcs_inferred_antecedents import evaluate import json import tempfile import subprocess import operator import collections BEGIN_DOCUMENT_REGEX = re.compile(r"#begi...
36.808333
166
0.679194
from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import os import sys from evaluate.arcs_inferred_antecedents import evaluate import json import tempfile import subprocess import operator import collections BEGIN_DOCUMENT_REGEX = re.compile(r"#begi...
true
true
f752575636b82a62fd7cf7ce099717094abc1708
10,951
py
Python
api/migrations/versions/8e5760ed365b_.py
9kittikul/machinaris
08b2306d91940e2f64436184ac3acc48b9f1a803
[ "Apache-2.0" ]
1
2022-01-12T19:56:31.000Z
2022-01-12T19:56:31.000Z
api/migrations/versions/8e5760ed365b_.py
9kittikul/machinaris
08b2306d91940e2f64436184ac3acc48b9f1a803
[ "Apache-2.0" ]
null
null
null
api/migrations/versions/8e5760ed365b_.py
9kittikul/machinaris
08b2306d91940e2f64436184ac3acc48b9f1a803
[ "Apache-2.0" ]
null
null
null
"""empty message Revision ID: 8e5760ed365b Revises: Create Date: 2021-06-20 09:49:52.813237 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '8e5760ed365b' down_revision = None branch_labels = None depends_on = None def upgrade(engine_name): globals()["up...
41.324528
105
0.675007
from alembic import op import sqlalchemy as sa revision = '8e5760ed365b' down_revision = None branch_labels = None depends_on = None def upgrade(engine_name): globals()["upgrade_%s" % engine_name]() def downgrade(engine_name): globals()["downgrade_%s" % engine_name]() def upgrade_(): op.creat...
true
true
f752582883d5b35388be28ba85a83f67d240da70
3,010
py
Python
scripts/update.py
vmchale/dhall-ansible
f1cd6c7151507e9151b341c8efe4effcef251388
[ "Apache-2.0" ]
null
null
null
scripts/update.py
vmchale/dhall-ansible
f1cd6c7151507e9151b341c8efe4effcef251388
[ "Apache-2.0" ]
null
null
null
scripts/update.py
vmchale/dhall-ansible
f1cd6c7151507e9151b341c8efe4effcef251388
[ "Apache-2.0" ]
null
null
null
#!/bin/env python3 # Copyright 2019 Red Hat # # 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...
35.833333
110
0.610631
import os from pathlib import Path from textwrap import dedent from typing import Any, Iterator, List def write(dest: Path, content: str) -> None: if content[-1] != "\n": content += "\n" if (dest.exists() and dest.read_text() != content) or not dest.exists(): dest.parent.mkdir(parents=True, ...
true
true
f752592c7fe59e8be90435734677a852bbdf71cf
723
py
Python
lambdas/setup/sonrai/graphql/__init__.py
sonraisecurity/control-tower-integration
838a91636a7f6f947fcdc624cb9f0ca6aab61e14
[ "MIT-0" ]
null
null
null
lambdas/setup/sonrai/graphql/__init__.py
sonraisecurity/control-tower-integration
838a91636a7f6f947fcdc624cb9f0ca6aab61e14
[ "MIT-0" ]
null
null
null
lambdas/setup/sonrai/graphql/__init__.py
sonraisecurity/control-tower-integration
838a91636a7f6f947fcdc624cb9f0ca6aab61e14
[ "MIT-0" ]
null
null
null
import threading import requests class APIClient: def __init__(self): super().__init__() self._thread_local = threading.local() def request(self, method, url, token, **kwargs): session = self._session() headers = kwargs.pop('headers', {}) if (not headers or 'Authorizat...
32.863636
104
0.644537
import threading import requests class APIClient: def __init__(self): super().__init__() self._thread_local = threading.local() def request(self, method, url, token, **kwargs): session = self._session() headers = kwargs.pop('headers', {}) if (not headers or 'Authorizat...
true
true
f752593da58e9a854df033bdad8ff818d4b41318
3,390
py
Python
api/migrations/0001_initial.py
jadsonlucio/TodoApp
0aaa0f0aa6753516b7fe4957ef5b64a13627fb46
[ "MIT" ]
1
2021-06-08T00:57:53.000Z
2021-06-08T00:57:53.000Z
api/migrations/0001_initial.py
jadsonlucio/TodoApp
0aaa0f0aa6753516b7fe4957ef5b64a13627fb46
[ "MIT" ]
1
2021-04-10T05:51:51.000Z
2021-04-10T05:51:51.000Z
api/migrations/0001_initial.py
jadsonlucio/TodoApp
0aaa0f0aa6753516b7fe4957ef5b64a13627fb46
[ "MIT" ]
null
null
null
# Generated by Django 3.2 on 2021-04-08 21:49 from django.conf import settings import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True ...
59.473684
329
0.648673
from django.conf import settings import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0012_alter...
true
true
f75259de7355897358c6b50579fdced9c6d59127
352
py
Python
account/urls.py
maysse17/account_basix_admin
136b994bd93bb27dede827e46ee4e5486952ab65
[ "MIT" ]
null
null
null
account/urls.py
maysse17/account_basix_admin
136b994bd93bb27dede827e46ee4e5486952ab65
[ "MIT" ]
null
null
null
account/urls.py
maysse17/account_basix_admin
136b994bd93bb27dede827e46ee4e5486952ab65
[ "MIT" ]
null
null
null
from django.urls import re_path from django.conf import settings from django.conf.urls.static import static from account.views import CreateUserView urlpatterns = [ re_path('^signup/$', CreateUserView.as_view(), name='signup'), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL + 'account/', docu...
27.076923
95
0.769886
from django.urls import re_path from django.conf import settings from django.conf.urls.static import static from account.views import CreateUserView urlpatterns = [ re_path('^signup/$', CreateUserView.as_view(), name='signup'), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL + 'account/', docu...
true
true
f7525ad42e18ecd2225cfc0c635320fc6660fb32
2,534
py
Python
telebot/plugins/meme.py
IloveOrbiter/TinyBot
1b89757859f2c493f8405120b2b8e848e5c6b554
[ "MIT" ]
null
null
null
telebot/plugins/meme.py
IloveOrbiter/TinyBot
1b89757859f2c493f8405120b2b8e848e5c6b554
[ "MIT" ]
null
null
null
telebot/plugins/meme.py
IloveOrbiter/TinyBot
1b89757859f2c493f8405120b2b8e848e5c6b554
[ "MIT" ]
null
null
null
""" Memes Plugin for Userbot usage = .meme someCharacter //default delay will be 3 By : - @Zero_cool7870 """ import asyncio from telebot import CMD_HELP from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern=r"meme", outgoing=True)) @telebot.on(sudo_cmd(pattern=r"meme", allow_sudo=True)) async def meme(e...
26.123711
85
0.511444
import asyncio from telebot import CMD_HELP from telebot.utils import admin_cmd @telebot.on(admin_cmd(pattern=r"meme", outgoing=True)) @telebot.on(sudo_cmd(pattern=r"meme", allow_sudo=True)) async def meme(event): if event.fwd_from: return memeVar = event.text sleepValue = 3 memeVar = memeVar...
true
true
f7525fa6497ff6b9b8dc0478e32d6735b7e86192
2,927
py
Python
tools/dubrovnik/router_map.py
physycom/slides
ff73de94997e39673d6d5c82b1bb4d9d0069fee6
[ "BSD-3-Clause" ]
1
2020-05-29T09:40:19.000Z
2020-05-29T09:40:19.000Z
tools/dubrovnik/router_map.py
physycom/slides
ff73de94997e39673d6d5c82b1bb4d9d0069fee6
[ "BSD-3-Clause" ]
null
null
null
tools/dubrovnik/router_map.py
physycom/slides
ff73de94997e39673d6d5c82b1bb4d9d0069fee6
[ "BSD-3-Clause" ]
2
2022-01-27T08:53:19.000Z
2022-03-28T07:14:56.000Z
#! /usr/bin/env python3 import os import json import folium import argparse import pandas as pd import mysql.connector from matplotlib import cm from matplotlib.colors import to_hex if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-c', '--cfg', type=str, required=True) args = ...
32.88764
161
0.645712
import os import json import folium import argparse import pandas as pd import mysql.connector from matplotlib import cm from matplotlib.colors import to_hex if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-c', '--cfg', type=str, required=True) args = parser.parse_args() w...
true
true
f7526036aadc9b76dbf2813bbae2651904f12059
17,680
py
Python
cinder/tests/unit/db/test_purge.py
lightsey/cinder
e03d68e42e57a63f8d0f3e177fb4287290612b24
[ "Apache-2.0" ]
3
2015-04-02T21:44:36.000Z
2016-04-29T21:19:04.000Z
cinder/tests/unit/db/test_purge.py
lightsey/cinder
e03d68e42e57a63f8d0f3e177fb4287290612b24
[ "Apache-2.0" ]
3
2016-04-29T21:45:26.000Z
2016-05-04T19:41:23.000Z
cinder/tests/unit/db/test_purge.py
lightsey/cinder
e03d68e42e57a63f8d0f3e177fb4287290612b24
[ "Apache-2.0" ]
4
2016-01-27T00:25:52.000Z
2021-03-25T19:54:08.000Z
# Copyright (C) 2015 OpenStack Foundation # 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 ...
44.422111
79
0.636991
import datetime import uuid from oslo_db import exception as db_exc from oslo_db.sqlalchemy import utils as sqlalchemyutils from oslo_utils import timeutils from sqlalchemy.dialects import sqlite from cinder import context from cinder import db from cinder.db.sqlalchemy import api as db_api from cinder import excep...
true
true
f7526076dc3a0e1d3a42184e08bba64ca4d0685d
1,115
py
Python
measurement/onewire.py
cgiacofei/pybrew
40062f9b6ccb96ca3cbbb9784434dd9281a9caba
[ "MIT" ]
null
null
null
measurement/onewire.py
cgiacofei/pybrew
40062f9b6ccb96ca3cbbb9784434dd9281a9caba
[ "MIT" ]
null
null
null
measurement/onewire.py
cgiacofei/pybrew
40062f9b6ccb96ca3cbbb9784434dd9281a9caba
[ "MIT" ]
null
null
null
""" Download the device tree overlay package use Robert C Nelson's source install: https://raw.github.com/RobertCNelson/tools/master/pkgs/dtc.sh After installing the software, make the file executable, and then run the bash file to install device-tree-overlay (dtc) from the source: > sudo chmod +x dtc.sh > sudo bash d...
27.875
86
0.690583
import os os.system("echo BB-W1:00A0 > /sys/devices/bone_capemgr.9/slots") class OneWire(object): def init(self, address, path='/sys/bus/w1/devices/'): self.device_path = path self.device_file = ''.join([self.device_path, address]) def list_devices(self): contents = os.listdir(self....
true
true
f75260f3ad6f785990f90160fe699ab339f2b7be
26,287
py
Python
lbry/lbry/extras/daemon/Components.py
AakashKhatu/lbry-sdk
27bbd916353ac391a5adbe7fdf03aecedc5f72b9
[ "MIT" ]
null
null
null
lbry/lbry/extras/daemon/Components.py
AakashKhatu/lbry-sdk
27bbd916353ac391a5adbe7fdf03aecedc5f72b9
[ "MIT" ]
null
null
null
lbry/lbry/extras/daemon/Components.py
AakashKhatu/lbry-sdk
27bbd916353ac391a5adbe7fdf03aecedc5f72b9
[ "MIT" ]
null
null
null
import hashlib import os import asyncio import logging import math import binascii import typing import base58 from aioupnp import __version__ as aioupnp_version from aioupnp.upnp import UPnP from aioupnp.fault import UPnPError from lbry import utils from lbry.dht.node import Node from lbry.dht.blob_announcer import ...
41.992013
119
0.657093
import hashlib import os import asyncio import logging import math import binascii import typing import base58 from aioupnp import __version__ as aioupnp_version from aioupnp.upnp import UPnP from aioupnp.fault import UPnPError from lbry import utils from lbry.dht.node import Node from lbry.dht.blob_announcer import ...
true
true
f752611eefd59bf48c75af1e2ca0d70801b6e954
1,657
py
Python
WBSX.py
ProgrammerTheUnique/Webbrowser-Sidekick
06e671b8c420667812128fb80b696c67ba35592d
[ "MIT" ]
null
null
null
WBSX.py
ProgrammerTheUnique/Webbrowser-Sidekick
06e671b8c420667812128fb80b696c67ba35592d
[ "MIT" ]
null
null
null
WBSX.py
ProgrammerTheUnique/Webbrowser-Sidekick
06e671b8c420667812128fb80b696c67ba35592d
[ "MIT" ]
null
null
null
import webbrowser def open_term(home_url, term): '''Open a search term in the home_url''' if ' ' in term: new_term=term.replace(' ', '%20') webbrowser.open_new_tab('%s/search?q=%s' % (home_url, new_term)) else: webbrowser.open_new_tab('%s/search?q=%s' % (home_url, term)) def wbsxcred...
43.605263
78
0.748944
import webbrowser def open_term(home_url, term): if ' ' in term: new_term=term.replace(' ', '%20') webbrowser.open_new_tab('%s/search?q=%s' % (home_url, new_term)) else: webbrowser.open_new_tab('%s/search?q=%s' % (home_url, term)) def wbsxcredits(): print('''Webbrowser-X credits: ...
true
true
f752628c65b8514f30f86fa1ea8c6cec80de59b9
2,110
py
Python
python/IECore/registerObject.py
bradleyhenke/cortex
f8245cc6c9464b1de9e6c6e57068248198e63de0
[ "BSD-3-Clause" ]
386
2015-01-02T11:10:43.000Z
2022-03-10T15:12:20.000Z
python/IECore/registerObject.py
bradleyhenke/cortex
f8245cc6c9464b1de9e6c6e57068248198e63de0
[ "BSD-3-Clause" ]
484
2015-01-09T18:28:06.000Z
2022-03-31T16:02:04.000Z
python/IECore/registerObject.py
bradleyhenke/cortex
f8245cc6c9464b1de9e6c6e57068248198e63de0
[ "BSD-3-Clause" ]
99
2015-01-28T23:18:04.000Z
2022-03-27T00:59:39.000Z
########################################################################## # # Copyright (c) 2007-2010, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
47.954545
76
0.7
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, import IECore def registerObject( typ, typId, baseClass = None ) : if not issubclass( typ, IECore.Object ) : raise TypeError( "registerObject called with non-Object class: %s" % typ ) IECore.registerRunTimeTyped( typ, typId, baseClass ...
true
true
f752633c1cca3530548069345de7a29dab65be55
40,287
py
Python
test/functional/p2p_compactblocks.py
Afrigonblockchain/Afrigon-Core
c1f11ae205d37d78da02599049aa41ebaf8ed3c5
[ "MIT" ]
null
null
null
test/functional/p2p_compactblocks.py
Afrigonblockchain/Afrigon-Core
c1f11ae205d37d78da02599049aa41ebaf8ed3c5
[ "MIT" ]
null
null
null
test/functional/p2p_compactblocks.py
Afrigonblockchain/Afrigon-Core
c1f11ae205d37d78da02599049aa41ebaf8ed3c5
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test compact blocks (BIP 152). Version 1 compact blocks are pre-segwit (txids) Version 2 compact block...
46.628472
500
0.672227
import random from decimal import Decimal from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment from test_framework.messages import BlockTransactions, BlockTransactionsRequest, calculate_shortid, CBlock, CBlockHeader, CInv, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, Fro...
true
true
f75263912fa72e188bdc02c8b55a4afd1546cd41
441
py
Python
test.py
applejenny66/snoopy
916700661976aef121c16c3cf1418f395eff54a6
[ "MIT" ]
null
null
null
test.py
applejenny66/snoopy
916700661976aef121c16c3cf1418f395eff54a6
[ "MIT" ]
null
null
null
test.py
applejenny66/snoopy
916700661976aef121c16c3cf1418f395eff54a6
[ "MIT" ]
null
null
null
import numpy import argparse import cv2 image = cv2.imread('pikachu.jpg') cv2.imshow("Original", image) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.imshow("Gray", gray) eq = cv2.equalizeHist(gray) ##cv2.imshow("Gray EQ", eq) #display two images in a figure cv2.imshow("Histogram Equalization", numpy.hstack([gr...
21
62
0.723356
import numpy import argparse import cv2 image = cv2.imread('pikachu.jpg') cv2.imshow("Original", image) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.imshow("Gray", gray) eq = cv2.equalizeHist(gray) cv2.imshow("Histogram Equalization", numpy.hstack([gray, eq])) cv2.imwrite("pikachu_eq.jpg", numpy.hstack([gray,...
true
true
f752647d919a4dadbf6b93af16ff79131b6e4d01
9,273
py
Python
test.py
mprimi/skill-bot
d0d0278944ee777b05b1970011952cc612d92cc4
[ "MIT" ]
8
2021-04-16T12:42:07.000Z
2021-12-16T16:53:34.000Z
test.py
mprimi/skill-bot
d0d0278944ee777b05b1970011952cc612d92cc4
[ "MIT" ]
2
2021-05-19T14:05:20.000Z
2021-12-17T01:21:02.000Z
test.py
mprimi/skill-bot
d0d0278944ee777b05b1970011952cc612d92cc4
[ "MIT" ]
2
2021-04-14T20:04:59.000Z
2021-11-21T18:47:24.000Z
def print_graph(g): print(f"People: {len(g.people)}") for pid, p in g.people.items(): print(f" * {p.name} ({p.id})") for s in p.skills: print(f" - {s.name} ({s.id})") print(f"Skills: {len(g.skills)}") for sid, s in g.skills.items(): print(f" * {s.name} ({s.id})") ...
28.88785
92
0.703656
def print_graph(g): print(f"People: {len(g.people)}") for pid, p in g.people.items(): print(f" * {p.name} ({p.id})") for s in p.skills: print(f" - {s.name} ({s.id})") print(f"Skills: {len(g.skills)}") for sid, s in g.skills.items(): print(f" * {s.name} ({s.id})") ...
true
true
f75266e1820205f8c21040ff2eea5508f1bc86c1
13,673
py
Python
reversion/models.py
sperrygrove/django-reversion
de5862a60e8fcfc9c14634dd51e004a0420a50b5
[ "BSD-3-Clause" ]
null
null
null
reversion/models.py
sperrygrove/django-reversion
de5862a60e8fcfc9c14634dd51e004a0420a50b5
[ "BSD-3-Clause" ]
null
null
null
reversion/models.py
sperrygrove/django-reversion
de5862a60e8fcfc9c14634dd51e004a0420a50b5
[ "BSD-3-Clause" ]
null
null
null
from __future__ import unicode_literals from collections import defaultdict from itertools import chain from django.contrib.contenttypes.models import ContentType try: from django.contrib.contenttypes.fields import GenericForeignKey except ImportError: # Django < 1.9 pragma: no cover from django.contrib.conten...
38.29972
117
0.630366
from __future__ import unicode_literals from collections import defaultdict from itertools import chain from django.contrib.contenttypes.models import ContentType try: from django.contrib.contenttypes.fields import GenericForeignKey except ImportError: from django.contrib.contenttypes.generic import GenericFor...
true
true
f75267577955178a49d614486d554b9c0f37fc35
660
py
Python
day3/day3b.py
lehoczkics/aoc2020
43e640694d05ffbb47568254aeba6d2b2a89ab04
[ "Unlicense" ]
null
null
null
day3/day3b.py
lehoczkics/aoc2020
43e640694d05ffbb47568254aeba6d2b2a89ab04
[ "Unlicense" ]
null
null
null
day3/day3b.py
lehoczkics/aoc2020
43e640694d05ffbb47568254aeba6d2b2a89ab04
[ "Unlicense" ]
null
null
null
#!/usr/bin/env python3 import os, re rshift = [1,3,5,7,1] dshift = [1,1,1,1,2] def splitter(word): return [char for char in word] for i in range(len(rshift)) : cou = 0 right = 0 lineno = 0 with open("input.txt") as f: for line in f: if lineno % dshift[i] == 1: ...
23.571429
79
0.466667
import os, re rshift = [1,3,5,7,1] dshift = [1,1,1,1,2] def splitter(word): return [char for char in word] for i in range(len(rshift)) : cou = 0 right = 0 lineno = 0 with open("input.txt") as f: for line in f: if lineno % dshift[i] == 1: lineno = lineno + 1 ...
true
true
f75267dc3072b03552ce31a930a8a3a0c0179b88
5,275
py
Python
info/modules/news/views.py
Dreamlilan/info23
ba662500ba2f9288d4b41d46b73c31501f326ecf
[ "MIT" ]
null
null
null
info/modules/news/views.py
Dreamlilan/info23
ba662500ba2f9288d4b41d46b73c31501f326ecf
[ "MIT" ]
null
null
null
info/modules/news/views.py
Dreamlilan/info23
ba662500ba2f9288d4b41d46b73c31501f326ecf
[ "MIT" ]
null
null
null
from flask import abort from flask import current_app, jsonify from flask import g from flask import json from flask import render_template from flask import request from flask import session from info import db from info.models import News, User, Comment from info.utils.common import user_login_data from info.utils.r...
26.641414
110
0.636588
from flask import abort from flask import current_app, jsonify from flask import g from flask import json from flask import render_template from flask import request from flask import session from info import db from info.models import News, User, Comment from info.utils.common import user_login_data from info.utils.r...
true
true
f752688710261afb606424ef99972a1b8b4d8bdd
10,200
py
Python
src/olympia/git/tests/test_commands.py
xlisachan/addons-server
5dedeb33e7ad3972e99101f2cb846266744bdd06
[ "BSD-3-Clause" ]
null
null
null
src/olympia/git/tests/test_commands.py
xlisachan/addons-server
5dedeb33e7ad3972e99101f2cb846266744bdd06
[ "BSD-3-Clause" ]
null
null
null
src/olympia/git/tests/test_commands.py
xlisachan/addons-server
5dedeb33e7ad3972e99101f2cb846266744bdd06
[ "BSD-3-Clause" ]
null
null
null
import datetime from pathlib import Path from unittest import mock import pytest from django.test.utils import override_settings from olympia import amo from olympia.amo.tests import ( TestCase, addon_factory, create_switch, version_factory, ) from olympia.git.utils import AddonGitRepository, Broken...
36.55914
79
0.685588
import datetime from pathlib import Path from unittest import mock import pytest from django.test.utils import override_settings from olympia import amo from olympia.amo.tests import ( TestCase, addon_factory, create_switch, version_factory, ) from olympia.git.utils import AddonGitRepository, Broken...
true
true
f7526895b6b8bbebd85d9acf9175b28c0449753e
572
py
Python
src/crawlers/uber-county-city.py
qmolee/Map-for-Lumpies
c8c5f7d418c4212cfe6be379908dc1eb42ef1a65
[ "MIT" ]
1
2021-01-25T07:20:52.000Z
2021-01-25T07:20:52.000Z
src/crawlers/uber-county-city.py
qmolee/Map-for-Lumpies
c8c5f7d418c4212cfe6be379908dc1eb42ef1a65
[ "MIT" ]
null
null
null
src/crawlers/uber-county-city.py
qmolee/Map-for-Lumpies
c8c5f7d418c4212cfe6be379908dc1eb42ef1a65
[ "MIT" ]
null
null
null
import requests import time import lxml from selenium import webdriver from bs4 import BeautifulSoup from sys import argv #open page driver = webdriver.Chrome(executable_path="/Users/chocolee/git/Map-for-Lumpie/src/crawlers/chromedriver") #load page with input model driver.get("https://www.ubereats.com/au/location"...
21.185185
105
0.755245
import requests import time import lxml from selenium import webdriver from bs4 import BeautifulSoup from sys import argv driver = webdriver.Chrome(executable_path="/Users/chocolee/git/Map-for-Lumpie/src/crawlers/chromedriver") driver.get("https://www.ubereats.com/au/location") source = driver.page_source soup = B...
true
true
f75269130fb2e48f80ae20b83e292e8572dca01a
19,416
py
Python
tools/chart_code_size.py
MakeItZone/circuitpython
7f803c0b51c333210ed267502422ed7bb28b9be7
[ "Unlicense", "BSD-3-Clause", "MIT-0", "MIT" ]
13
2021-01-27T13:12:17.000Z
2022-02-25T20:16:00.000Z
tools/chart_code_size.py
MakeItZone/circuitpython
7f803c0b51c333210ed267502422ed7bb28b9be7
[ "Unlicense", "BSD-3-Clause", "MIT-0", "MIT" ]
1
2020-12-30T11:48:24.000Z
2020-12-30T11:48:24.000Z
tools/chart_code_size.py
MakeItZone/circuitpython
7f803c0b51c333210ed267502422ed7bb28b9be7
[ "Unlicense", "BSD-3-Clause", "MIT-0", "MIT" ]
6
2021-05-12T20:45:46.000Z
2021-12-27T04:51:56.000Z
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT # This script renders a graph of the CircuitPython rom image. # It takes the single elf file and uses objdump to get its contents. import pygraphviz ...
42.300654
234
0.536825
import pygraphviz as pgv import click import sh objdump = sh.arm_none_eabi_objdump def parse_hex(h): return int("0x" + h, 0) BAD_JUMPS = ["UNPREDICTABLE", "_etext"] SPECIAL_NODE_COLORS = { "main": "pink", "exception_table": "green" } @click.command() @click.argument("elf_filename") def do_all_the_thi...
true
true
f7526930e2f1645f9120f01e16372af759c8eda2
5,707
py
Python
src/pysdjango/homepage_app/scripts/homepage_app/test_alphavantage_crypto.py
NIAGroup/PyStockAnalyze-2019
49a92b3b9ff487295bb3a30a88f1ca388281a77f
[ "MIT" ]
2
2019-03-21T04:42:23.000Z
2019-04-05T23:06:06.000Z
src/pysdjango/homepage_app/scripts/homepage_app/test_alphavantage_crypto.py
NIAGroup/PyStockAnalyze
49a92b3b9ff487295bb3a30a88f1ca388281a77f
[ "MIT" ]
48
2019-02-17T20:51:39.000Z
2019-03-12T21:40:04.000Z
src/pysdjango/homepage_app/scripts/homepage_app/test_alphavantage_crypto.py
NIAGroup/PyStockAnalyze
49a92b3b9ff487295bb3a30a88f1ca388281a77f
[ "MIT" ]
1
2019-02-17T20:47:07.000Z
2019-02-17T20:47:07.000Z
from alpha_vantage.cryptocurrencies import CryptoCurrencies import time as timer import socket, requests from bs4 import BeautifulSoup from random import randint ''' #### CryptoCurrencies Methods: #### #### get_digital_currency_intraday, #### #### get_digital_currency_daily, ...
33.180233
111
0.663571
from alpha_vantage.cryptocurrencies import CryptoCurrencies import time as timer import socket, requests from bs4 import BeautifulSoup from random import randint def isBehindFirewall(): host_name = socket.gethostname() host_ip = "-"+socket.gethostbyname(host_name) if host_ip.find("-10.") > -1: return True retur...
true
true
f7526a214e3070af1abe0ab76c08dc7cc5f56c27
391
py
Python
setup.py
kim-younghan/CompoundScalingSeg
8fad8f03ac02f3613466572a542ae5b0f50ed067
[ "CC0-1.0" ]
2
2020-06-17T07:44:01.000Z
2020-11-16T12:50:14.000Z
setup.py
kim-younghan/CompoundScalingSeg
8fad8f03ac02f3613466572a542ae5b0f50ed067
[ "CC0-1.0" ]
null
null
null
setup.py
kim-younghan/CompoundScalingSeg
8fad8f03ac02f3613466572a542ae5b0f50ed067
[ "CC0-1.0" ]
null
null
null
from setuptools import setup, find_packages setup( name = 'CompoundScalingSeg', version = '1.1', description = 'Experiment on compound scaling effects U-Net segmentation', author = 'Younghan Kim', author_email = 'godppkyh@mosqtech.com', install_requires= [], ...
32.583333
82
0.606138
from setuptools import setup, find_packages setup( name = 'CompoundScalingSeg', version = '1.1', description = 'Experiment on compound scaling effects U-Net segmentation', author = 'Younghan Kim', author_email = 'godppkyh@mosqtech.com', install_requires= [], ...
true
true
f7526cb15c5d8823dc34787b95417e96189cfac0
854
py
Python
tests/core/p2p-proto/test_peer_discovery.py
gsalgado/trinity
e35154226ffae471e625547027368e664ec5e422
[ "MIT" ]
1
2021-04-07T07:33:28.000Z
2021-04-07T07:33:28.000Z
tests/core/p2p-proto/test_peer_discovery.py
gsalgado/trinity
e35154226ffae471e625547027368e664ec5e422
[ "MIT" ]
null
null
null
tests/core/p2p-proto/test_peer_discovery.py
gsalgado/trinity
e35154226ffae471e625547027368e664ec5e422
[ "MIT" ]
null
null
null
import pytest from eth_enr.tools.factories import ENRFactory from eth_utils import to_bytes from eth.chains.ropsten import ROPSTEN_GENESIS_HEADER, ROPSTEN_VM_CONFIGURATION from eth.db.atomic import AtomicDB from eth.db.chain import ChainDB from trinity.components.builtin.peer_discovery.component import generate_eth...
34.16
98
0.823185
import pytest from eth_enr.tools.factories import ENRFactory from eth_utils import to_bytes from eth.chains.ropsten import ROPSTEN_GENESIS_HEADER, ROPSTEN_VM_CONFIGURATION from eth.db.atomic import AtomicDB from eth.db.chain import ChainDB from trinity.components.builtin.peer_discovery.component import generate_eth...
true
true
f7526e8488fb750f6b4c946df499eb4c7fb7a886
2,672
py
Python
app/controllers/users/update.py
Brunoro811/api_dangels
21c064eaa4f5009412dddc9676044d6cc08a5b65
[ "MIT" ]
null
null
null
app/controllers/users/update.py
Brunoro811/api_dangels
21c064eaa4f5009412dddc9676044d6cc08a5b65
[ "MIT" ]
null
null
null
app/controllers/users/update.py
Brunoro811/api_dangels
21c064eaa4f5009412dddc9676044d6cc08a5b65
[ "MIT" ]
null
null
null
from flask import current_app from http import HTTPStatus from sqlalchemy.orm import Session from sqlalchemy.orm.exc import NoResultFound from app.controllers.exc.user_erros import ( BodyNoContent, TypeSellerInvalid, ) from app.models.user_completed.users_completed import UsersCompletedModel from app.models...
28.731183
74
0.621257
from flask import current_app from http import HTTPStatus from sqlalchemy.orm import Session from sqlalchemy.orm.exc import NoResultFound from app.controllers.exc.user_erros import ( BodyNoContent, TypeSellerInvalid, ) from app.models.user_completed.users_completed import UsersCompletedModel from app.models...
true
true
f7526f1e25b33e8b54abedc4e16828e8286822c7
798
py
Python
microtbs_rl/algorithms/baselines/enjoy_baseline_random.py
alex-petrenko/simple-reinforcement-learning
d0da1d9026d1f05e2552d08e56fbe58ad869fafd
[ "MIT" ]
8
2018-03-05T05:13:39.000Z
2021-02-27T03:12:05.000Z
microtbs_rl/algorithms/baselines/enjoy_baseline_random.py
alex-petrenko/simple-reinforcement-learning
d0da1d9026d1f05e2552d08e56fbe58ad869fafd
[ "MIT" ]
null
null
null
microtbs_rl/algorithms/baselines/enjoy_baseline_random.py
alex-petrenko/simple-reinforcement-learning
d0da1d9026d1f05e2552d08e56fbe58ad869fafd
[ "MIT" ]
4
2018-09-04T04:44:26.000Z
2021-07-22T06:34:51.000Z
""" Always handy to have a random agent. If an RL agent performs significantly better than random, then it must be at least learning something. """ import gym from microtbs_rl import envs from microtbs_rl.algorithms.common import run_policy_loop from microtbs_rl.algorithms.common.agent import AgentRandom from mic...
22.166667
102
0.754386
import gym from microtbs_rl import envs from microtbs_rl.algorithms.common import run_policy_loop from microtbs_rl.algorithms.common.agent import AgentRandom from microtbs_rl.utils.common_utils import * logger = logging.getLogger(os.path.basename(__file__)) def enjoy(env_id, max_num_episodes=1000000, fps=6): ...
true
true
f7526f374ec7bb8c0990fdae26f8db8e3ffc442b
1,589
py
Python
openbb_terminal/cryptocurrency/discovery/coinmarketcap_model.py
tehcoderer/GamestonkTerminal
54a1b6f545a0016c576e9e00eef5c003d229dacf
[ "MIT" ]
255
2022-03-29T16:43:51.000Z
2022-03-31T23:57:08.000Z
openbb_terminal/cryptocurrency/discovery/coinmarketcap_model.py
tehcoderer/GamestonkTerminal
54a1b6f545a0016c576e9e00eef5c003d229dacf
[ "MIT" ]
14
2022-03-29T14:20:33.000Z
2022-03-31T23:39:20.000Z
openbb_terminal/cryptocurrency/discovery/coinmarketcap_model.py
tehcoderer/GamestonkTerminal
54a1b6f545a0016c576e9e00eef5c003d229dacf
[ "MIT" ]
24
2022-03-29T15:28:56.000Z
2022-03-31T23:54:15.000Z
"""CoinMarketCap model""" __docformat__ = "numpy" import logging import pandas as pd from coinmarketcapapi import CoinMarketCapAPI, CoinMarketCapAPIError import openbb_terminal.config_terminal as cfg from openbb_terminal.decorators import log_start_end from openbb_terminal.rich_config import console logger = loggin...
27.396552
85
0.611076
__docformat__ = "numpy" import logging import pandas as pd from coinmarketcapapi import CoinMarketCapAPI, CoinMarketCapAPIError import openbb_terminal.config_terminal as cfg from openbb_terminal.decorators import log_start_end from openbb_terminal.rich_config import console logger = logging.getLogger(__name__) FIL...
true
true
f7526fa6a349b2e15bd6948acd649767e9cdae7a
900
py
Python
test/UnitTest.py
Wenbo16/OpenSCAD-parser
f4231b8d7fb562d746a260d3a65fad442aa1c9fa
[ "MIT" ]
null
null
null
test/UnitTest.py
Wenbo16/OpenSCAD-parser
f4231b8d7fb562d746a260d3a65fad442aa1c9fa
[ "MIT" ]
null
null
null
test/UnitTest.py
Wenbo16/OpenSCAD-parser
f4231b8d7fb562d746a260d3a65fad442aa1c9fa
[ "MIT" ]
null
null
null
import unittest class TestStringMethods(unittest.TestCase): def test_upper(self): self.assertEqual('foo'.upper(), 'FOO') def test_isupper(self): self.assertTrue('FOO'.isupper()) self.assertFalse('Foo'.isupper()) def test_split(self): s = 'hello world' self.assertE...
32.142857
80
0.463333
import unittest class TestStringMethods(unittest.TestCase): def test_upper(self): self.assertEqual('foo'.upper(), 'FOO') def test_isupper(self): self.assertTrue('FOO'.isupper()) self.assertFalse('Foo'.isupper()) def test_split(self): s = 'hello world' self.assertE...
true
true
f7527056991be8c0db55e9ebe99c7cd3992094e4
41,052
py
Python
nssrc/com/citrix/netscaler/nitro/resource/config/gslb/gslbservice.py
guardicore/nitro-python
5346a5086134aead80968f15a41ff527adaa0ec1
[ "Apache-2.0" ]
null
null
null
nssrc/com/citrix/netscaler/nitro/resource/config/gslb/gslbservice.py
guardicore/nitro-python
5346a5086134aead80968f15a41ff527adaa0ec1
[ "Apache-2.0" ]
null
null
null
nssrc/com/citrix/netscaler/nitro/resource/config/gslb/gslbservice.py
guardicore/nitro-python
5346a5086134aead80968f15a41ff527adaa0ec1
[ "Apache-2.0" ]
null
null
null
# # Copyright (c) 2021 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
31.74942
446
0.721378
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro...
true
true
f75270677e8c28fb9ad0424edefc208dd54d9b12
9,625
py
Python
rtlib/slash/__init__.py
tuna2134sub/rt-bot
0daa8a5fd231ed35b76a2b25d12d3247e300d406
[ "BSD-4-Clause" ]
null
null
null
rtlib/slash/__init__.py
tuna2134sub/rt-bot
0daa8a5fd231ed35b76a2b25d12d3247e300d406
[ "BSD-4-Clause" ]
null
null
null
rtlib/slash/__init__.py
tuna2134sub/rt-bot
0daa8a5fd231ed35b76a2b25d12d3247e300d406
[ "BSD-4-Clause" ]
null
null
null
# rtlib - Slash Command from discord.ext import commands import discord from .types import ( ApplicationCommand as ApplicationCommandType, OptionType ) from .application_command import ApplicationCommand from typing import Type, List, Dict from .executor import executor from inspect import signature ...
38.043478
96
0.512623
from discord.ext import commands import discord from .types import ( ApplicationCommand as ApplicationCommandType, OptionType ) from .application_command import ApplicationCommand from typing import Type, List, Dict from .executor import executor from inspect import signature from .option import Opti...
true
true
f752709cdd56bb37342f38f6da0a5d63877c2d7e
243
py
Python
pypis/asynchelper/asynchelper/__init__.py
darkarp/asyncloop
c49500e757ecdecff49fe839a64baced90261968
[ "MIT" ]
null
null
null
pypis/asynchelper/asynchelper/__init__.py
darkarp/asyncloop
c49500e757ecdecff49fe839a64baced90261968
[ "MIT" ]
2
2021-04-10T20:51:28.000Z
2021-04-10T21:11:55.000Z
pypis/asynchelper/asynchelper/__init__.py
darkarp/asyncloop
c49500e757ecdecff49fe839a64baced90261968
[ "MIT" ]
2
2021-04-10T16:23:56.000Z
2021-04-10T21:05:33.000Z
"""asynchelper - Allows execution of unlimited number of asynchronous tasks while limiting the amount of active concurrent ones.""" __version__ = '0.1.4' __author__ = 'Mario Nascimento <mario@whitehathacking.tech>' __all__ = ["TaskExecutor"]
40.5
131
0.773663
__version__ = '0.1.4' __author__ = 'Mario Nascimento <mario@whitehathacking.tech>' __all__ = ["TaskExecutor"]
true
true
f75270e0c6f0a3a1205a09de0a877df2c10fde8b
684
py
Python
conan_tests/test_regression/packages/bzip2_test.py
jgsogo/test
724373ed2b3bf616431b1904e9af8b531c3843b0
[ "MIT" ]
null
null
null
conan_tests/test_regression/packages/bzip2_test.py
jgsogo/test
724373ed2b3bf616431b1904e9af8b531c3843b0
[ "MIT" ]
null
null
null
conan_tests/test_regression/packages/bzip2_test.py
jgsogo/test
724373ed2b3bf616431b1904e9af8b531c3843b0
[ "MIT" ]
null
null
null
from conan_tests.test_regression.utils.base_exe import BaseExeTest, run, conan_create_command class Bzip2Test(BaseExeTest): libref = "bzip2/1.0.6@conan/stable" librepo = "https://github.com/lasote/conan-bzip2.git" branch = "release/1.0.6" def setUp(self): super(Bzip2Test, self).setUp() ...
32.571429
93
0.649123
from conan_tests.test_regression.utils.base_exe import BaseExeTest, run, conan_create_command class Bzip2Test(BaseExeTest): libref = "bzip2/1.0.6@conan/stable" librepo = "https://github.com/lasote/conan-bzip2.git" branch = "release/1.0.6" def setUp(self): super(Bzip2Test, self).setUp() ...
true
true
f75270fd676204473594343f69e7995d0946504b
3,708
py
Python
mmcv/parallel/collate.py
techkang/mmcv
333eb6a8f964f005d4c0f34c3214ac2036bb228c
[ "Apache-2.0" ]
null
null
null
mmcv/parallel/collate.py
techkang/mmcv
333eb6a8f964f005d4c0f34c3214ac2036bb228c
[ "Apache-2.0" ]
null
null
null
mmcv/parallel/collate.py
techkang/mmcv
333eb6a8f964f005d4c0f34c3214ac2036bb228c
[ "Apache-2.0" ]
null
null
null
# Copyright (c) OpenMMLab. All rights reserved. from collections.abc import Mapping, Sequence import torch import torch.nn.functional as F from torch.utils.data.dataloader import default_collate from .data_container import DataContainer def collate(batch, samples_per_gpu=1): """Puts each data field into a tenso...
43.623529
83
0.526969
from collections.abc import Mapping, Sequence import torch import torch.nn.functional as F from torch.utils.data.dataloader import default_collate from .data_container import DataContainer def collate(batch, samples_per_gpu=1): if not isinstance(batch, Sequence): raise TypeError(f'{batch.dtype} is not ...
true
true
f75271b283526f580e17ed7fc9db3f46c629dee8
259
py
Python
A. Helpful Maths.py
rashidulhasanhridoy/Codeforces-Problem-Solve-with-Python-3
6ccc55fe66e17af1e43e8a1322d9a7df78a2235d
[ "Apache-2.0" ]
1
2020-07-21T18:00:59.000Z
2020-07-21T18:00:59.000Z
A. Helpful Maths.py
rashidulhasanhridoy/Codeforces-Problem-Solve-with-Python-3
6ccc55fe66e17af1e43e8a1322d9a7df78a2235d
[ "Apache-2.0" ]
null
null
null
A. Helpful Maths.py
rashidulhasanhridoy/Codeforces-Problem-Solve-with-Python-3
6ccc55fe66e17af1e43e8a1322d9a7df78a2235d
[ "Apache-2.0" ]
null
null
null
Numbers = [] count = 0 N = str(input('')) for i in N: if i != '+': Numbers.append(i) else: count += 1 Numbers = sorted(Numbers) for j in Numbers: print(j, end = '') if count != 0: print('+', end = '') count -= 1
18.5
28
0.46332
Numbers = [] count = 0 N = str(input('')) for i in N: if i != '+': Numbers.append(i) else: count += 1 Numbers = sorted(Numbers) for j in Numbers: print(j, end = '') if count != 0: print('+', end = '') count -= 1
true
true
f75272a210c2e6f51a259d91c832f00dd65439ff
39
py
Python
molybdenum/__init__.py
mexposit/molybdenum
a8b86b9300868c553183ec921115678e838c2779
[ "MIT" ]
2
2022-02-28T08:45:46.000Z
2022-03-11T02:30:18.000Z
molybdenum/__init__.py
mexposit/molybdenum
a8b86b9300868c553183ec921115678e838c2779
[ "MIT" ]
3
2021-12-08T09:07:11.000Z
2021-12-08T18:27:06.000Z
molybdenum/__init__.py
mexposit/molybdenum
a8b86b9300868c553183ec921115678e838c2779
[ "MIT" ]
null
null
null
from .molybdenum import MolybdenumModel
39
39
0.897436
from .molybdenum import MolybdenumModel
true
true
f7527430b937354eac7d30677ba21624ea715bf0
3,653
py
Python
exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/pushover.py
tr3ck3r/linklight
5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7
[ "MIT" ]
null
null
null
exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/pushover.py
tr3ck3r/linklight
5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7
[ "MIT" ]
null
null
null
exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/pushover.py
tr3ck3r/linklight
5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7
[ "MIT" ]
null
null
null
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_vers...
28.539063
101
0.635642
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: pushover short_description: Send notifications via U(https...
true
true
f752749966bcf1e95471cb096f83168e44eaa5d3
1,002
py
Python
lib/db.py
sbshrey/twitch-bot-tutorial
c3ea5da5381e083744d469cc4a0df4fa44af5dd0
[ "BSD-3-Clause" ]
27
2020-04-14T06:57:56.000Z
2022-02-13T20:27:17.000Z
lib/db.py
sbshrey/twitch-bot-tutorial
c3ea5da5381e083744d469cc4a0df4fa44af5dd0
[ "BSD-3-Clause" ]
5
2020-02-21T02:21:18.000Z
2021-05-03T18:06:53.000Z
lib/db.py
sbshrey/twitch-bot-tutorial
c3ea5da5381e083744d469cc4a0df4fa44af5dd0
[ "BSD-3-Clause" ]
19
2020-05-27T06:28:07.000Z
2021-06-26T14:11:09.000Z
from sqlite3 import connect cxn = connect("./files/database.db", check_same_thread=False) cur = cxn.cursor() def with_commit(func): def inner(*args, **kwargs): func(*args, **kwargs) commit() return inner @with_commit def build(): scriptexec("./files/script.sql") def commit(): cxn.commit() def close(): ...
17.275862
61
0.708583
from sqlite3 import connect cxn = connect("./files/database.db", check_same_thread=False) cur = cxn.cursor() def with_commit(func): def inner(*args, **kwargs): func(*args, **kwargs) commit() return inner @with_commit def build(): scriptexec("./files/script.sql") def commit(): cxn.commit() def close(): ...
true
true
f75275632389af237e21fcfd4cf4e861e115f6a9
227
py
Python
tests/integration/cli/fxt.py
nickderobertis/flexlate
81d6dbc2d87219a2a89266d6e8fb03310a24a3a1
[ "MIT" ]
null
null
null
tests/integration/cli/fxt.py
nickderobertis/flexlate
81d6dbc2d87219a2a89266d6e8fb03310a24a3a1
[ "MIT" ]
25
2021-12-05T18:57:53.000Z
2022-03-29T13:45:47.000Z
tests/integration/cli/fxt.py
nickderobertis/flexlate
81d6dbc2d87219a2a89266d6e8fb03310a24a3a1
[ "MIT" ]
null
null
null
from functools import partial from tests.integration.cli_stub import fxt as _fxt, ExceptionHandling # Ignore exceptions so that we can test error codes instead fxt = partial(_fxt, exception_handling=ExceptionHandling.IGNORE)
32.428571
69
0.832599
from functools import partial from tests.integration.cli_stub import fxt as _fxt, ExceptionHandling fxt = partial(_fxt, exception_handling=ExceptionHandling.IGNORE)
true
true
f752765f813eb84045cc7947a910bc5ee4bb2deb
348
py
Python
corner detection.py
Tejas-Nanaware/Learning-OpenCV
4956db7f7f90d9d4a44327aebc2f809e4d9b2ca3
[ "MIT" ]
null
null
null
corner detection.py
Tejas-Nanaware/Learning-OpenCV
4956db7f7f90d9d4a44327aebc2f809e4d9b2ca3
[ "MIT" ]
1
2017-06-14T10:32:10.000Z
2017-06-14T10:32:10.000Z
corner detection.py
Tejas-Nanaware/Learning-OpenCV
4956db7f7f90d9d4a44327aebc2f809e4d9b2ca3
[ "MIT" ]
null
null
null
import cv2 import numpy as np img = cv2.imread('corner detection.jpg') gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) gray = np.float32(gray) corners = cv2.goodFeaturesToTrack(gray, 100, 0.01, 10) corners = np.int0(corners) for corner in corners: x, y = corner.ravel() cv2.circle(img, (x,y), 3, 255, -1) cv2.imshow('...
21.75
54
0.706897
import cv2 import numpy as np img = cv2.imread('corner detection.jpg') gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) gray = np.float32(gray) corners = cv2.goodFeaturesToTrack(gray, 100, 0.01, 10) corners = np.int0(corners) for corner in corners: x, y = corner.ravel() cv2.circle(img, (x,y), 3, 255, -1) cv2.imshow('...
true
true
f7527791c8434d356137134e0a394160b1e0ed2c
11,749
py
Python
src/compas/geometry/primitives/polyline.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
235
2017-11-07T07:33:22.000Z
2022-03-25T16:20:00.000Z
src/compas/geometry/primitives/polyline.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
770
2017-09-22T13:42:06.000Z
2022-03-31T21:26:45.000Z
src/compas/geometry/primitives/polyline.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
99
2017-11-06T23:15:28.000Z
2022-03-25T16:05:36.000Z
from __future__ import print_function from __future__ import absolute_import from __future__ import division from compas.geometry import allclose from compas.geometry import transform_points from compas.geometry.predicates import is_point_on_line from compas.geometry.primitives import Line from compas.geometry.primit...
29.594458
118
0.524811
from __future__ import print_function from __future__ import absolute_import from __future__ import division from compas.geometry import allclose from compas.geometry import transform_points from compas.geometry.predicates import is_point_on_line from compas.geometry.primitives import Line from compas.geometry.primit...
true
true
f7527795b623675b2520db00cf296ecdfb184a2d
1,911
py
Python
tests/test_mask_intensityd.py
Irme/MONAI
dc4bf661831b14f4231cb325cc1b15d38c1e406c
[ "Apache-2.0" ]
3
2020-10-12T02:13:27.000Z
2021-04-14T11:46:21.000Z
tests/test_mask_intensityd.py
JZK00/MONAI
49e693c4e7df83dc1f8ab87349373de9263188a9
[ "Apache-2.0" ]
1
2020-09-17T12:41:51.000Z
2020-09-29T15:20:37.000Z
tests/test_mask_intensityd.py
JZK00/MONAI
49e693c4e7df83dc1f8ab87349373de9263188a9
[ "Apache-2.0" ]
1
2020-06-11T13:03:02.000Z
2020-06-11T13:03:02.000Z
# Copyright 2020 MONAI Consortium # 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...
40.659574
115
0.569335
import unittest import numpy as np from parameterized import parameterized from monai.transforms import MaskIntensityd TEST_CASE_1 = [ {"keys": "img", "mask_data": np.array([[[0, 0, 0], [0, 1, 0], [0, 0, 0]]])}, {"img": np.array([[[1, 1, 1], [2, 2, 2], [3, 3, 3]], [[4, 4, 4], [5, 5, 5], [6, 6, 6]]])}, n...
true
true
f7527837bf6f84667da928d740ff92e3bb98cf95
10,162
py
Python
Graph/graph.py
suyash248/data_structures
41a732cebf791ed63edbce10329251f03b763ccf
[ "Apache-2.0" ]
7
2017-12-13T05:54:29.000Z
2022-03-25T09:10:59.000Z
Graph/graph.py
suyash248/data_structures
41a732cebf791ed63edbce10329251f03b763ccf
[ "Apache-2.0" ]
null
null
null
Graph/graph.py
suyash248/data_structures
41a732cebf791ed63edbce10329251f03b763ccf
[ "Apache-2.0" ]
4
2019-05-22T02:51:56.000Z
2021-05-23T10:49:57.000Z
from __future__ import annotations __author__ = "Suyash Soni" __email__ = "suyash.soni248@gmail.com" from _collections import defaultdict from uuid import uuid4 from typing import TypeVar, Generic, List, Set, Tuple, Dict T = TypeVar('T') class Vertex(Generic[T]): def __init__(self, data: T): self._id_: ...
37.498155
160
0.583547
from __future__ import annotations __author__ = "Suyash Soni" __email__ = "suyash.soni248@gmail.com" from _collections import defaultdict from uuid import uuid4 from typing import TypeVar, Generic, List, Set, Tuple, Dict T = TypeVar('T') class Vertex(Generic[T]): def __init__(self, data: T): self._id_: ...
true
true