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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71fa83d6989172da3743eb9fd560fc906515688 | 10,607 | py | Python | tests/commandline/stubber_cli_test.py | Josverl/mipystubber | 504814224b38208e9886661b181a57d2b9077be1 | [
"MIT"
] | 1 | 2019-03-26T16:03:04.000Z | 2019-03-26T16:03:04.000Z | tests/commandline/stubber_cli_test.py | Josverl/mipystubber | 504814224b38208e9886661b181a57d2b9077be1 | [
"MIT"
] | null | null | null | tests/commandline/stubber_cli_test.py | Josverl/mipystubber | 504814224b38208e9886661b181a57d2b9077be1 | [
"MIT"
] | null | null | null | from typing import List
import pytest
from pytest_mock import MockerFixture
from mock import MagicMock
from pathlib import Path
from click.testing import CliRunner
# module under test :
import stubber.stubber as stubber
def test_stubber_help():
# check basic commandline sanity check
runner = CliRunner()
... | 42.258964 | 136 | 0.614217 | from typing import List
import pytest
from pytest_mock import MockerFixture
from mock import MagicMock
from pathlib import Path
from click.testing import CliRunner
import stubber.stubber as stubber
def test_stubber_help():
runner = CliRunner()
result = runner.invoke(stubber.stubber_cli, ["--help"])
... | true | true |
f71fa8aed93c8b08ae1ae6669c787edf3afcae3d | 12,641 | py | Python | python/ccxt/async_support/base/exchange.py | gabvladov/ccxt | c26ba54afe1617d7314bf6714427a4db6d0c6381 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | gabvladov/ccxt | c26ba54afe1617d7314bf6714427a4db6d0c6381 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | gabvladov/ccxt | c26ba54afe1617d7314bf6714427a4db6d0c6381 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.20.94'
# -----------------------------------------------------------------------------
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import a... | 41.719472 | 355 | 0.610316 |
__version__ = '1.20.94'
import asyncio
import concurrent
import socket
import time
import math
import random
import certifi
import aiohttp
import ssl
import sys
import yarl
from ccxt.async_support.base.throttle import throttle
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Exchange... | true | true |
f71fa96f8684f8b86d25128c15599561e0aa97b2 | 11,711 | py | Python | fs_patches_of_hybrid_cloud/cherry_for_B038/nova_cascaded/nova/virt/vmwareapi/vmware_images.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 2 | 2015-06-15T02:16:33.000Z | 2022-02-23T07:10:38.000Z | patches_tool/vcloud_patch/code/nova/virt/vmwareapi/vmware_images.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 7 | 2016-05-13T06:39:45.000Z | 2016-05-20T02:55:31.000Z | fs_patches_of_hybrid_cloud/cherry_for_B038/nova_cascaded/nova/virt/vmwareapi/vmware_images.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 4 | 2015-11-02T04:02:50.000Z | 2021-05-13T17:06:00.000Z | # Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | 40.663194 | 80 | 0.61566 |
import os
from oslo.config import cfg
from nova import exception
from nova import image
from nova.openstack.common import log as logging
from nova.openstack.common import strutils
from nova.openstack.common import units
from nova.virt.vmwareapi import constants
from nova.virt.vmwareapi impo... | true | true |
f71fa9e010cfc60587fdfbd98f199c76f3a648ad | 30,587 | py | Python | mypyc/irbuild/expression.py | sileht/mypy | 334876a0cdb80d76333e4976238fd7f42fbaabf2 | [
"PSF-2.0"
] | 1 | 2021-09-25T16:12:01.000Z | 2021-09-25T16:12:01.000Z | mypyc/irbuild/expression.py | sileht/mypy | 334876a0cdb80d76333e4976238fd7f42fbaabf2 | [
"PSF-2.0"
] | 1 | 2021-08-21T07:40:45.000Z | 2021-08-21T07:40:45.000Z | mypyc/irbuild/expression.py | sileht/mypy | 334876a0cdb80d76333e4976238fd7f42fbaabf2 | [
"PSF-2.0"
] | 1 | 2021-08-21T07:39:57.000Z | 2021-08-21T07:39:57.000Z | """Transform mypy expression ASTs to mypyc IR (Intermediate Representation).
The top-level AST transformation logic is implemented in mypyc.irbuild.visitor
and mypyc.irbuild.builder.
"""
from typing import List, Optional, Union, Callable, cast
from mypy.nodes import (
Expression, NameExpr, MemberExpr, SuperExpr,... | 38.914758 | 96 | 0.639193 |
from typing import List, Optional, Union, Callable, cast
from mypy.nodes import (
Expression, NameExpr, MemberExpr, SuperExpr, CallExpr, UnaryExpr, OpExpr, IndexExpr,
ConditionalExpr, ComparisonExpr, IntExpr, FloatExpr, ComplexExpr, StrExpr,
BytesExpr, EllipsisExpr, ListExpr, TupleExpr, DictExpr, SetExpr,... | true | true |
f71fac3e2c7d6447e6fb71445d88074908c05f79 | 507 | py | Python | neighborapp/migrations/0005_auto_20220104_1254.py | Kips-alih/neighborhood | 216d81b352c0f7f61812280f3aa816f8450a61bc | [
"MIT"
] | null | null | null | neighborapp/migrations/0005_auto_20220104_1254.py | Kips-alih/neighborhood | 216d81b352c0f7f61812280f3aa816f8450a61bc | [
"MIT"
] | null | null | null | neighborapp/migrations/0005_auto_20220104_1254.py | Kips-alih/neighborhood | 216d81b352c0f7f61812280f3aa816f8450a61bc | [
"MIT"
] | null | null | null | # Generated by Django 2.2.24 on 2022-01-04 09:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('neighborapp', '0004_neighborhood_description'),
]
operations = [
migrations.AlterField(
model_... | 25.35 | 119 | 0.658777 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('neighborapp', '0004_neighborhood_description'),
]
operations = [
migrations.AlterField(
model_name='neighborhood',
name='location'... | true | true |
f71fada5cf3ee5e227b5f46f44161960eda0e4a2 | 4,783 | py | Python | main.py | PiotrBosowski/prl-browser | eabfcc9307e0ff27d490841b80f9d1cdc06f022f | [
"MIT"
] | null | null | null | main.py | PiotrBosowski/prl-browser | eabfcc9307e0ff27d490841b80f9d1cdc06f022f | [
"MIT"
] | null | null | null | main.py | PiotrBosowski/prl-browser | eabfcc9307e0ff27d490841b80f9d1cdc06f022f | [
"MIT"
] | null | null | null | from bottle import *
import os
import settings
from domain.training_model import Training
from training_utils.combined_outputs import overview_csv
@get(f'/<session_name>/<model_name>/refresh')
def invalidate_cache(session_name, model_name):
global global_models
global_models = Training.load_all()
return r... | 29.708075 | 81 | 0.655237 | from bottle import *
import os
import settings
from domain.training_model import Training
from training_utils.combined_outputs import overview_csv
@get(f'/<session_name>/<model_name>/refresh')
def invalidate_cache(session_name, model_name):
global global_models
global_models = Training.load_all()
return r... | true | true |
f71fada6cd8a268a05f3827d0723a58a4d32aa28 | 9,366 | py | Python | MDSimsEval/pca_analysis.py | MikeXydas/MDSimsEval | 6c32bd8b74e421120beca18d18c3e58fc8f85247 | [
"MIT"
] | 1 | 2020-06-30T12:56:41.000Z | 2020-06-30T12:56:41.000Z | MDSimsEval/pca_analysis.py | MikeXydas/MDSimsEval | 6c32bd8b74e421120beca18d18c3e58fc8f85247 | [
"MIT"
] | 2 | 2021-06-08T21:53:33.000Z | 2021-12-13T20:43:42.000Z | MDSimsEval/pca_analysis.py | MikeXydas/MDSimsEval | 6c32bd8b74e421120beca18d18c3e58fc8f85247 | [
"MIT"
] | null | null | null | import math
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from tqdm import tqdm
def scree_plot(analysis_actors_dict, dir_path, pcs_on_scree_plot=50, variance_ratio_line=0.75):
"""
Creates a plot with the scree plots for each ligand and saves it on the specified ... | 46.366337 | 120 | 0.69069 | import math
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
from tqdm import tqdm
def scree_plot(analysis_actors_dict, dir_path, pcs_on_scree_plot=50, variance_ratio_line=0.75):
plot_cols = 3
plot_rows = math.ceil(len(analysis_actors_dict['Agonists']) + len(a... | true | true |
f71faed40fe9843e23daeb4a3ae28c21eb2bec96 | 1,395 | py | Python | tests/test_rand_spatial_crop_samples.py | sudohainguyen/MONAI | 89f8a39a1c0bc6f480522c443ee7813cea21df47 | [
"Apache-2.0"
] | 2 | 2020-06-23T16:03:45.000Z | 2020-06-25T05:30:45.000Z | tests/test_rand_spatial_crop_samples.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | null | null | null | tests/test_rand_spatial_crop_samples.py | Scitator/MONAI | a42b563acf0c7504cee18ee84c8af2eff6e948a7 | [
"Apache-2.0"
] | 1 | 2020-09-14T13:16:01.000Z | 2020-09-14T13:16:01.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... | 34.875 | 74 | 0.712545 |
import unittest
import numpy as np
from parameterized import parameterized
from monai.transforms import RandSpatialCropSamples
TEST_CASE_1 = [
{"roi_size": [3, 3, 3], "num_samples": 4, "random_center": True},
np.random.randint(0, 2, size=[3, 3, 3, 3]),
(3, 3, 3, 3),
]
TEST_CASE_2 = [
{"roi_... | true | true |
f71fafdcdc00789924a0f65e4fdb20825b916e5f | 52,274 | py | Python | pymilvus/orm/collection.py | jingkl/pymilvus | f74b4741b7480d4e1740e1ea2d120c96f01bb56a | [
"Apache-2.0"
] | null | null | null | pymilvus/orm/collection.py | jingkl/pymilvus | f74b4741b7480d4e1740e1ea2d120c96f01bb56a | [
"Apache-2.0"
] | null | null | null | pymilvus/orm/collection.py | jingkl/pymilvus | f74b4741b7480d4e1740e1ea2d120c96f01bb56a | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2019-2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 43.309031 | 120 | 0.600318 |
import copy
import json
import pandas
from .connections import get_connection
from .schema import (
CollectionSchema,
FieldSchema,
parse_fields_from_data,
infer_dtype_bydata,
)
from .prepare import Prepare
from .partition import Partition
from .index import Index
from .search import SearchR... | true | true |
f71fb01cbdb1f124478ac2b092b7ac4885231833 | 119 | py | Python | examples/test_error.py | ak1ra24/pytest-md-report | 9d861a9237176e9dd1e6872c197f5bb5985ee049 | [
"MIT"
] | 9 | 2020-05-06T20:54:29.000Z | 2022-03-27T04:11:38.000Z | examples/test_error.py | solisa986/pytest-md-report | a6cdeda92ef8f1ab64c346a86a085ce9e1585880 | [
"MIT"
] | null | null | null | examples/test_error.py | solisa986/pytest-md-report | a6cdeda92ef8f1ab64c346a86a085ce9e1585880 | [
"MIT"
] | 3 | 2021-05-05T19:58:33.000Z | 2021-08-12T07:14:52.000Z | def test_error(invalid_fixture):
pass
class Test:
def test_error(self, invalid_fixture):
assert True
| 14.875 | 42 | 0.697479 | def test_error(invalid_fixture):
pass
class Test:
def test_error(self, invalid_fixture):
assert True
| true | true |
f71fb03c0051a7dd823c621bfe4bd61238f148c4 | 2,121 | py | Python | ciphers/rabin_miller.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | 1,568 | 2019-04-25T11:54:45.000Z | 2022-03-31T23:35:23.000Z | ciphers/rabin_miller.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | 58 | 2019-02-20T10:45:50.000Z | 2020-09-30T12:18:45.000Z | ciphers/rabin_miller.py | joeyzhou85/python | 9c0cbe33076a570a3c02825b7c6d9866a760e777 | [
"MIT"
] | 464 | 2019-04-17T04:57:16.000Z | 2022-03-31T04:12:57.000Z | from __future__ import print_function
# Primality Testing with the Rabin-Miller Algorithm
import random
def rabinMiller(num):
s = num - 1
t = 0
while s % 2 == 0:
s = s // 2
t += 1
for trials in range(5):
a = random.randrange(2, num - 1)
v = pow(a, s, num)
if v... | 32.630769 | 80 | 0.474305 | from __future__ import print_function
import random
def rabinMiller(num):
s = num - 1
t = 0
while s % 2 == 0:
s = s // 2
t += 1
for trials in range(5):
a = random.randrange(2, num - 1)
v = pow(a, s, num)
if v != 1:
i = 0
while v != (nu... | true | true |
f71fb110925949ff47a2cad996420b5abb79125c | 4,468 | py | Python | dimod/generators/chimera.py | pau557/dimod | d3c6d3abf23182b035e1100c46f7c947202edefb | [
"Apache-2.0"
] | null | null | null | dimod/generators/chimera.py | pau557/dimod | d3c6d3abf23182b035e1100c46f7c947202edefb | [
"Apache-2.0"
] | 24 | 2021-07-09T08:19:47.000Z | 2022-03-08T08:15:48.000Z | dimod/generators/chimera.py | pau557/dimod | d3c6d3abf23182b035e1100c46f7c947202edefb | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave 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... | 29.012987 | 94 | 0.574754 |
from __future__ import absolute_import
import numpy as np
import numpy.random
from dimod.binary_quadratic_model import BinaryQuadraticModel
from dimod.decorators import graph_argument
from dimod.vartypes import SPIN
__all__ = ['chimera_anticluster']
@graph_argument('subgraph', allow_None=True)
def c... | true | true |
f71fb1734f8db11d01bd46d0696b2f6a7c2a050c | 1,845 | py | Python | mediagoblin/plugins/subtitles/models.py | mtlynch/mediagoblin | b5ee42aed44052de114c6e45edb56856d2868858 | [
"CC0-1.0"
] | 7 | 2020-05-27T03:57:21.000Z | 2021-04-21T02:17:39.000Z | mediagoblin/plugins/subtitles/models.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | null | null | null | mediagoblin/plugins/subtitles/models.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | 2 | 2019-05-13T14:42:34.000Z | 2021-08-28T10:36:46.000Z | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2016 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of... | 36.9 | 80 | 0.732249 |
from sqlalchemy import Column, Integer, Unicode, ForeignKey
from sqlalchemy.orm import relationship
from mediagoblin.db.models import User
from mediagoblin.db.base import Base,MediaEntry
class MediaSubtitleFile(Base):
__tablename__ = "core__subtitle_files"
id = Column(Integer, primary_key=True... | true | true |
f71fb1cc1129767d19d13b370609bf72cca258f1 | 1,830 | py | Python | scripts/agregar_empresas_gentor.py | edgarvalli/gentor_backend | 115cadfc802cb5130b62aba5c9b6050cb5f0a466 | [
"MIT"
] | null | null | null | scripts/agregar_empresas_gentor.py | edgarvalli/gentor_backend | 115cadfc802cb5130b62aba5c9b6050cb5f0a466 | [
"MIT"
] | null | null | null | scripts/agregar_empresas_gentor.py | edgarvalli/gentor_backend | 115cadfc802cb5130b62aba5c9b6050cb5f0a466 | [
"MIT"
] | null | null | null | from set_root_path import set_root_path
set_root_path()
import db.sql_server as db
empresas = [
{
"RazonSocial": "GENTOR, S.A. DE C.V.",
"RFC": "GEN760712EM0"
},
{
"RazonSocial": "SERVICIOS CORPORATIVOS GENTOR, S.A.",
"RFC": "SCG931026LW1"
},
{
"RazonSocial... | 24.4 | 84 | 0.519672 | from set_root_path import set_root_path
set_root_path()
import db.sql_server as db
empresas = [
{
"RazonSocial": "GENTOR, S.A. DE C.V.",
"RFC": "GEN760712EM0"
},
{
"RazonSocial": "SERVICIOS CORPORATIVOS GENTOR, S.A.",
"RFC": "SCG931026LW1"
},
{
"RazonSocial... | true | true |
f71fb21ddb1fedaa154d0f69fe5a945c4b945b9c | 13,241 | py | Python | scrapy/core/engine.py | lizhaoxing1/scrapy-comment-zh | 17c6279c63d9733598539589091c5a9551f341f6 | [
"BSD-3-Clause"
] | null | null | null | scrapy/core/engine.py | lizhaoxing1/scrapy-comment-zh | 17c6279c63d9733598539589091c5a9551f341f6 | [
"BSD-3-Clause"
] | null | null | null | scrapy/core/engine.py | lizhaoxing1/scrapy-comment-zh | 17c6279c63d9733598539589091c5a9551f341f6 | [
"BSD-3-Clause"
] | null | null | null | """
This is the Scrapy engine which controls the Scheduler, Downloader and Spiders.
For more information see docs/topics/architecture.rst
"""
import logging
from time import time
from twisted.internet import defer, task
from twisted.python.failure import Failure
from scrapy import signals
from scrapy.core.scraper i... | 37.939828 | 130 | 0.624726 | import logging
from time import time
from twisted.internet import defer, task
from twisted.python.failure import Failure
from scrapy import signals
from scrapy.core.scraper import Scraper
from scrapy.exceptions import DontCloseSpider
from scrapy.http import Response, Request
from scrapy.utils.misc import load_object
... | true | true |
f71fb24b1ca2ef3817592da8e3c5f8b5ac48df99 | 780 | py | Python | nicos_mlz/kws2/setups/uvspectro.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/kws2/setups/uvspectro.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/kws2/setups/uvspectro.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
description = 'controlling the UV-vis spectrometer and LEDs'
group = 'optional'
tango_base = 'tango://phys.kws2.frm2:10000/kws2/'
devices = dict(
OceanView = device('nicos.devices.entangle.DigitalOutput',
description = 'spectrometer trigger interval (0 to switch off)',
tan... | 33.913043 | 72 | 0.65641 |
description = 'controlling the UV-vis spectrometer and LEDs'
group = 'optional'
tango_base = 'tango://phys.kws2.frm2:10000/kws2/'
devices = dict(
OceanView = device('nicos.devices.entangle.DigitalOutput',
description = 'spectrometer trigger interval (0 to switch off)',
tangodevice = tango_base +... | true | true |
f71fb300004e91ff987107bb558165bb8d7b340e | 14,538 | py | Python | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | chatto_transform/datastores/sqlalchemy_datastore.py | chatto-hub-test2/Spaceboy2 | 7b6b91baf06290e6b047ae75e7ea61cee4846b3a | [
"Unlicense",
"MIT"
] | null | null | null | import pandas
from ..schema.schema_base import *
from .datastore_base import DataStore
from .odo_datastore import OdoDataStore
from ..config import config
from functools import lru_cache, partial
from sqlalchemy import Table, MetaData, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.automap import ... | 35.896296 | 155 | 0.623882 | import pandas
from ..schema.schema_base import *
from .datastore_base import DataStore
from .odo_datastore import OdoDataStore
from ..config import config
from functools import lru_cache, partial
from sqlalchemy import Table, MetaData, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.automap import ... | true | true |
f71fb3203ce46c39849c5a3bac229726738a23a1 | 4,139 | py | Python | src/core/network/llnms-scan-network.py | marvins/LLNMS | ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d | [
"MIT"
] | null | null | null | src/core/network/llnms-scan-network.py | marvins/LLNMS | ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d | [
"MIT"
] | null | null | null | src/core/network/llnms-scan-network.py | marvins/LLNMS | ebc15418e1a5dddafdb3e55cea4e8cb71f619b2d | [
"MIT"
] | 1 | 2020-12-16T09:28:26.000Z | 2020-12-16T09:28:26.000Z | #!/usr/bin/env python
#
# File: llnms-scan-network.py
# Author: Marvin Smith
# Date: 6/13/2015
#
# Purpose: Scan LLNMS networks
#
__author__ = 'Marvin Smith'
# Python Libraries
import argparse, os, sys
# LLNMS Libraries
if os.environ['LLNMS_HOME'] is not None:
sys.path.append(os.environ['L... | 32.590551 | 132 | 0.530563 |
__author__ = 'Marvin Smith'
import argparse, os, sys
if os.environ['LLNMS_HOME'] is not None:
sys.path.append(os.environ['LLNMS_HOME'] + '/lib')
import llnms
def Parse_Command_Line():
parser = argparse.ArgumentParser( description='Scan an LLNMS network.' )
parser.add_argument('-v',... | true | true |
f71fb3d05a7fffde16b9485af0a723ccfc10ba6f | 16,760 | py | Python | maven_proj_graph/pkg1/mvnsortmod1.py | lg-alabris/swagger-ui | fdb06ad6dc3dd9c416b08c8f7909c37cfcf1ece4 | [
"Apache-2.0"
] | null | null | null | maven_proj_graph/pkg1/mvnsortmod1.py | lg-alabris/swagger-ui | fdb06ad6dc3dd9c416b08c8f7909c37cfcf1ece4 | [
"Apache-2.0"
] | null | null | null | maven_proj_graph/pkg1/mvnsortmod1.py | lg-alabris/swagger-ui | fdb06ad6dc3dd9c416b08c8f7909c37cfcf1ece4 | [
"Apache-2.0"
] | null | null | null | '''
======================================================================
Created on Jan 14, 2018
PURPOSE: this module provides classes to read Maven projects from git or other repos
specifically intended to create the graph of multiple project dependencies
ROADMAP: TODO -
1. review how properties ... | 36.514161 | 178 | 0.515752 | import os
import subprocess
import xml.etree.cElementTree as ET
import re
import urllib.request
class Util(object):
mvn_pom_ns = {"mvn":"http://maven.apache.org/POM/4.0.0"}
def __init__(self):
pass
@staticmethod
def get_tag_value(name, section):
s = ('mvn:%... | true | true |
f71fb4b548decad7d92f6c012d1d10217c8e029e | 2,063 | py | Python | Union_Find/1070.Accounts Merge/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 12 | 2019-05-04T04:21:27.000Z | 2022-03-02T07:06:57.000Z | Union_Find/1070.Accounts Merge/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 1 | 2019-07-24T18:43:53.000Z | 2019-07-24T18:43:53.000Z | Union_Find/1070.Accounts Merge/Solution.py | Zhenye-Na/LxxxCode | afd79d790d0a7495d75e6650f80adaa99bd0ff07 | [
"MIT"
] | 10 | 2019-07-01T04:03:04.000Z | 2022-03-09T03:57:37.000Z | from collections import defaultdict
class Solution:
"""
@param accounts: List[List[str]]
@return: return a List[List[str]]
"""
def accountsMerge(self, accounts):
# write your code here
merged = []
if not accounts or len(accounts) == 0:
return merged
s... | 27.506667 | 85 | 0.561318 | from collections import defaultdict
class Solution:
def accountsMerge(self, accounts):
merged = []
if not accounts or len(accounts) == 0:
return merged
self.forward_index = self.create_forward_index(accounts)
self.inverted_index = self.create_inverted_index(... | true | true |
f71fb575e9c0c22da60dd6194084df2483a9ba88 | 3,979 | py | Python | tests/test_detect_score.py | pgftennis/tennis_analysis_tool | 9f43545fa2b502930ec27a4de634ebc45e65cb19 | [
"MIT"
] | 1 | 2022-01-14T10:35:00.000Z | 2022-01-14T10:35:00.000Z | tests/test_detect_score.py | pgftennis/tennis_analysis_tool | 9f43545fa2b502930ec27a4de634ebc45e65cb19 | [
"MIT"
] | null | null | null | tests/test_detect_score.py | pgftennis/tennis_analysis_tool | 9f43545fa2b502930ec27a4de634ebc45e65cb19 | [
"MIT"
] | null | null | null | import unittest
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
sys.path.append(str(Path(__file__).parent.parent / "src/predict"))
import src.predict.detect_score as detect_score
class TestDetectScore(unittest.TestCase):
def setUp(self):#設定
self.ds=detect_score.Detect... | 32.08871 | 78 | 0.60191 | import unittest
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
sys.path.append(str(Path(__file__).parent.parent / "src/predict"))
import src.predict.detect_score as detect_score
class TestDetectScore(unittest.TestCase):
def setUp(self):
self.ds=detect_score.DetectSco... | true | true |
f71fb5d233f60d4940a1f40506e107449b9cb848 | 837 | py | Python | aql/connector.py | ryansb/aql | bc9f11aaf06caabe15981fb33b5ef37a60ce700a | [
"MIT"
] | 24 | 2020-07-16T11:47:28.000Z | 2021-12-02T20:38:52.000Z | aql/connector.py | ryansb/aql | bc9f11aaf06caabe15981fb33b5ef37a60ce700a | [
"MIT"
] | 37 | 2020-10-17T14:04:05.000Z | 2022-02-05T05:01:08.000Z | aql/connector.py | ryansb/aql | bc9f11aaf06caabe15981fb33b5ef37a60ce700a | [
"MIT"
] | 1 | 2019-10-26T03:45:16.000Z | 2019-10-26T03:45:16.000Z | # Copyright 2020 John Reese
# Licensed under the MIT license
import re
from typing import Any, Pattern, Union
from .engines.base import Connection
from .errors import InvalidURI
from .types import Location
_uri_regex: Pattern = re.compile(r"(?P<engine>\w+)://(?P<location>.+)")
def connect(location: Union[str, Loca... | 32.192308 | 85 | 0.688172 |
import re
from typing import Any, Pattern, Union
from .engines.base import Connection
from .errors import InvalidURI
from .types import Location
_uri_regex: Pattern = re.compile(r"(?P<engine>\w+)://(?P<location>.+)")
def connect(location: Union[str, Location], *args: Any, **kwargs: Any) -> Connection:
if isi... | true | true |
f71fb6028cbb2b09f79e06a91c06d14c015af377 | 2,712 | py | Python | utils.py | TNLC/pycalc | a60e996c5e4e1b6fdae5da124864cdf9a7178d19 | [
"Apache-2.0"
] | null | null | null | utils.py | TNLC/pycalc | a60e996c5e4e1b6fdae5da124864cdf9a7178d19 | [
"Apache-2.0"
] | null | null | null | utils.py | TNLC/pycalc | a60e996c5e4e1b6fdae5da124864cdf9a7178d19 | [
"Apache-2.0"
] | null | null | null | import math
from rply import LexerGenerator, ParserGenerator
def build_lexer():
# LEXERGENERATOR INSTANZIEREN
lexer_generator = LexerGenerator()
# WHITESPACES IGNORIEREN
lexer_generator.ignore(r'\s+')
# ZAHLEN ERKENNEN
# -? => ENTWEDER MINUS ODER NICHT
# \.? => ENTWEDER EIN PUNKT ODER NICH... | 32.674699 | 68 | 0.625369 | import math
from rply import LexerGenerator, ParserGenerator
def build_lexer():
lexer_generator = LexerGenerator()
lexer_generator.ignore(r'\s+')
lexer_generator.add('NUM', r'-?[0-9]*\.?[0-9]+')
lexer_generator.add('ADD', r'\+')
lexer_generator.... | true | true |
f71fb63636601da0239ffd402fc4be7612c8b4ab | 4,587 | py | Python | ca_municipalities/people.py | dogooderapp/scrapers-ca | 5e852eea93f05f3f397eec318d3094a3b1b0b458 | [
"MIT"
] | 19 | 2015-05-26T03:18:50.000Z | 2022-01-31T03:27:41.000Z | ca_municipalities/people.py | dogooderapp/scrapers-ca | 5e852eea93f05f3f397eec318d3094a3b1b0b458 | [
"MIT"
] | 119 | 2015-01-09T06:09:35.000Z | 2022-01-20T23:05:05.000Z | ca_municipalities/people.py | dogooderapp/scrapers-ca | 5e852eea93f05f3f397eec318d3094a3b1b0b458 | [
"MIT"
] | 17 | 2015-11-23T05:00:10.000Z | 2021-09-15T16:03:33.000Z | from utils import CSVScraper, CanadianPerson as Person
from pupa.scrape import Organization, Post
from collections import defaultdict
import re
class CanadaMunicipalitiesPersonScraper(CSVScraper):
csv_url = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRrGXQy8qk16OhuTjlccoGB4jL5e8X1CEqRbg896ufLdh67DQk9nuGm-o... | 42.869159 | 176 | 0.514716 | from utils import CSVScraper, CanadianPerson as Person
from pupa.scrape import Organization, Post
from collections import defaultdict
import re
class CanadaMunicipalitiesPersonScraper(CSVScraper):
csv_url = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRrGXQy8qk16OhuTjlccoGB4jL5e8X1CEqRbg896ufLdh67DQk9nuGm-o... | true | true |
f71fb66f5197af2f7a2dd9fb62e51560772987ee | 398 | py | Python | tests/connection/test_cursor.py | coverwallet/pysoni | 49d3a8acb101436ad0724749572be2ad9d86f3ae | [
"MIT"
] | 5 | 2019-07-08T15:38:06.000Z | 2022-03-24T20:36:19.000Z | tests/connection/test_cursor.py | coverwallet/pysoni | 49d3a8acb101436ad0724749572be2ad9d86f3ae | [
"MIT"
] | 2 | 2019-07-07T23:26:32.000Z | 2020-06-04T07:43:24.000Z | tests/connection/test_cursor.py | coverwallet/pysoni | 49d3a8acb101436ad0724749572be2ad9d86f3ae | [
"MIT"
] | 1 | 2019-05-31T09:11:22.000Z | 2019-05-31T09:11:22.000Z | def test_cursor_triggers_cursor_in_the_connection(open_connection):
open_connection.cursor()
open_connection._connection_handler.cursor.assert_called_once()
def test_cursor_returns_a_cursor_in_the_handler(open_connection, mocker):
cursor_mock = mocker.Mock()
open_connection._connection_handler.cursor.... | 39.8 | 73 | 0.831658 | def test_cursor_triggers_cursor_in_the_connection(open_connection):
open_connection.cursor()
open_connection._connection_handler.cursor.assert_called_once()
def test_cursor_returns_a_cursor_in_the_handler(open_connection, mocker):
cursor_mock = mocker.Mock()
open_connection._connection_handler.cursor.... | true | true |
f71fb695ceaa12f53778fae43e8d0268e9cde5f9 | 3,235 | py | Python | server/config/settings.py | sudosubin/playground-gunicorn | 770b2db062446e47a92b37fd3488f0e657157293 | [
"MIT"
] | null | null | null | server/config/settings.py | sudosubin/playground-gunicorn | 770b2db062446e47a92b37fd3488f0e657157293 | [
"MIT"
] | null | null | null | server/config/settings.py | sudosubin/playground-gunicorn | 770b2db062446e47a92b37fd3488f0e657157293 | [
"MIT"
] | null | null | null | """
Django settings for config project.
Generated by 'django-admin startproject' using Django 4.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from pathlib ... | 26.08871 | 91 | 0.703246 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-n1vl4be=11s&5oo0^453rw&9(g3v0pjb6=t4ze@d_3j4i3)y+y'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contr... | true | true |
f71fb6ffafd818eedc205dc12f215cb79fa5ad0e | 680 | py | Python | sa/profiles/Vyatta/Vyatta/get_capabilities.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/Vyatta/Vyatta/get_capabilities.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/Vyatta/Vyatta/get_capabilities.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Vyatta.Vyatta.get_capabilities
# ---------------------------------------------------------------------
# Copyright (C) 2007-2015 The NOC Project
# See LICENSE for details
# -------------------------------------------------... | 30.909091 | 73 | 0.457353 |
from noc.sa.profiles.Generic.get_capabilities import Script as BaseScript
class Script(BaseScript):
name = "Vyatta.Vyatta.get_capabilities"
def has_lldp_cli(self):
r = self.cli("show lldp neighbors")
return "LLDP not configured" not in r
| true | true |
f71fb8631c4b145396e2bba66374e05637da08a5 | 130 | py | Python | db_utils.py | bizmarcin/thefridge | 13bde29a57aea09fecf5ec2f28ce013adf6c4d08 | [
"MIT"
] | 1 | 2019-07-01T13:04:02.000Z | 2019-07-01T13:04:02.000Z | db_utils.py | bizmarcin/thefridge | 13bde29a57aea09fecf5ec2f28ce013adf6c4d08 | [
"MIT"
] | 2 | 2020-07-17T09:05:59.000Z | 2021-05-09T06:42:06.000Z | db_utils.py | bizmarcin/thefridge | 13bde29a57aea09fecf5ec2f28ce013adf6c4d08 | [
"MIT"
] | null | null | null | import sqlite3
def get_connection():
conn = sqlite3.connect('fridge.db')
conn.row_factory = sqlite3.Row
return conn
| 16.25 | 39 | 0.7 | import sqlite3
def get_connection():
conn = sqlite3.connect('fridge.db')
conn.row_factory = sqlite3.Row
return conn
| true | true |
f71fb9c25aa2d31e0378e8ac7911871707f58f10 | 6,328 | py | Python | tests/components/switch/test_command_line.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | 1 | 2016-07-14T05:20:54.000Z | 2016-07-14T05:20:54.000Z | tests/components/switch/test_command_line.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | tests/components/switch/test_command_line.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | 1 | 2018-11-22T13:55:23.000Z | 2018-11-22T13:55:23.000Z | """the tests for the Command line switch platform."""
import json
import os
import tempfile
import unittest
from homeassistant.const import STATE_ON, STATE_OFF
import homeassistant.components.switch as switch
import homeassistant.components.switch.command_line as command_line
from tests.common import get_test_home_as... | 35.751412 | 79 | 0.533028 | import json
import os
import tempfile
import unittest
from homeassistant.const import STATE_ON, STATE_OFF
import homeassistant.components.switch as switch
import homeassistant.components.switch.command_line as command_line
from tests.common import get_test_home_assistant
class TestCommandSwitch(unittest.TestCase):
... | true | true |
f71fb9e8ec48b2f9258997378e50488a34fc3cb5 | 2,033 | py | Python | scripts/utils/connection.py | CostaDiego/product-complaint-classification | 42d44210553577616dcf8ac4bf616b587fa02e8c | [
"MIT"
] | null | null | null | scripts/utils/connection.py | CostaDiego/product-complaint-classification | 42d44210553577616dcf8ac4bf616b587fa02e8c | [
"MIT"
] | null | null | null | scripts/utils/connection.py | CostaDiego/product-complaint-classification | 42d44210553577616dcf8ac4bf616b587fa02e8c | [
"MIT"
] | null | null | null | import psycopg2
from getpass import getpass
class DatabaseConection(object):
"""
"""
def __init__(self, host: str, database: str, user: str):
self._con = None
self._host = host
self._database = database
self._user = user
self.connected = False
try:
... | 26.064103 | 65 | 0.484506 | import psycopg2
from getpass import getpass
class DatabaseConection(object):
def __init__(self, host: str, database: str, user: str):
self._con = None
self._host = host
self._database = database
self._user = user
self.connected = False
try:
self._co... | true | true |
f71fbb8b5e0dc57ce6f0bd235b70ff2b45cd4410 | 4,913 | py | Python | ilustrado/util.py | ml-evs/ilustrado | 3121ecaff9cb517f3946b2283bf50dce499caad9 | [
"MIT"
] | 3 | 2019-10-31T20:54:55.000Z | 2022-01-05T16:39:43.000Z | ilustrado/util.py | ml-evs/ilustrado | 3121ecaff9cb517f3946b2283bf50dce499caad9 | [
"MIT"
] | null | null | null | ilustrado/util.py | ml-evs/ilustrado | 3121ecaff9cb517f3946b2283bf50dce499caad9 | [
"MIT"
] | 2 | 2019-11-29T11:34:11.000Z | 2020-08-12T12:31:48.000Z | # coding: utf-8
""" Catch-all file for utility functions.
"""
import sys
import logging
import numpy as np
from matador.compute import ComputeTask
from matador.utils.cell_utils import cart2frac, cart2abc
LOG = logging.getLogger("ilustrado")
LOG.setLevel(logging.DEBUG)
def strip_useless(doc, to_run=False):
""... | 28.730994 | 102 | 0.574802 |
import sys
import logging
import numpy as np
from matador.compute import ComputeTask
from matador.utils.cell_utils import cart2frac, cart2abc
LOG = logging.getLogger("ilustrado")
LOG.setLevel(logging.DEBUG)
def strip_useless(doc, to_run=False):
stripped_doc = dict()
if to_run:
keys = [
... | true | true |
f71fbc58ba45ce332cf36e06106fa51f669a4b79 | 16,543 | py | Python | services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | null | null | null | services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | 29 | 2018-11-13T09:39:29.000Z | 2022-03-22T10:11:32.000Z | services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/base_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | null | null | null | """The scheduler shall be run as a background task.
Based on oSparc pipelines, it monitors when to start the next celery task(s), either one at a time or as a group of tasks.
In principle the Scheduler maintains the comp_runs table in the database.
It contains how the pipeline was run and by whom.
It also contains the... | 38.651869 | 150 | 0.609684 |
import asyncio
import logging
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from typing import Callable, Dict, List, Optional, Set, Tuple, cast
import networkx as nx
from aiopg.sa.engine import Engine
from models_library.projects import ProjectID
from models_library.projects_nodes_io im... | true | true |
f71fbf2af7ee4f4be9f4ac329665e4e092b4627e | 1,045 | py | Python | tests/pyre/filesystem/local_rootNotDirectory.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/filesystem/local_rootNotDirectory.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/filesystem/local_rootNotDirectory.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2018 all rights reserved
#
"""
Verify that attempts to create local filesystems with nonexistent roots fails as expected
"""
def test():
# support
import pyre.primitives
# my package
import pyre.filesyste... | 21.770833 | 89 | 0.643062 |
def test():
import pyre.primitives
import pyre.filesystem
dummy = pyre.primitives.path("./local_rootNotDirectory.py")
try:
pyre.filesystem.local(root=dummy)
assert False
# if it fails as expected
except pyre.filesystem.MountPointE... | true | true |
f71fc0279e6c6df13e14b65f4c5bea90b17f596c | 21,395 | py | Python | pytorchtools/ptnetworks/ResNetCIFAR.py | Criscraft/pytorch_classification | d5772963e55ce218ae4719fb7f85604263aab65f | [
"MIT"
] | null | null | null | pytorchtools/ptnetworks/ResNetCIFAR.py | Criscraft/pytorch_classification | d5772963e55ce218ae4719fb7f85604263aab65f | [
"MIT"
] | null | null | null | pytorchtools/ptnetworks/ResNetCIFAR.py | Criscraft/pytorch_classification | d5772963e55ce218ae4719fb7f85604263aab65f | [
"MIT"
] | null | null | null | from collections import OrderedDict
import torch
from torch import Tensor
import torch.nn as nn
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from ptnetworks.ActivationTracker import ActivationTracker
from typing import Type, Any, Callable, Union, List, Optional
class ResNetCIFAR(nn.Module):... | 39.329044 | 111 | 0.621874 | from collections import OrderedDict
import torch
from torch import Tensor
import torch.nn as nn
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from ptnetworks.ActivationTracker import ActivationTracker
from typing import Type, Any, Callable, Union, List, Optional
class ResNetCIFAR(nn.Module):... | true | true |
f71fc26c9b8a2256095ae1cb28a68d64d9c6fef3 | 20,784 | py | Python | gym_minigrid/extendedminigrid.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | null | null | null | gym_minigrid/extendedminigrid.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | 6 | 2021-03-18T21:24:56.000Z | 2022-03-11T23:34:25.000Z | gym_minigrid/extendedminigrid.py | pierg/wiseml-patterns | 2decf2954001296bd04261b00ae144f53359a2b8 | [
"BSD-3-Clause"
] | null | null | null | from gym_minigrid.minigrid import *
from configurations import config_grabber as cg
import math
import operator
from functools import reduce
import traceback
import numpy as np
config = cg.Configuration.grab()
AGENT_VIEW_SIZE = config.agent_view_size
EXTRA_OBSERVATIONS_SIZE = 5
OBS_ARRAY_SIZE = (AGENT_VIEW_SIZE, A... | 31.301205 | 126 | 0.520737 | from gym_minigrid.minigrid import *
from configurations import config_grabber as cg
import math
import operator
from functools import reduce
import traceback
import numpy as np
config = cg.Configuration.grab()
AGENT_VIEW_SIZE = config.agent_view_size
EXTRA_OBSERVATIONS_SIZE = 5
OBS_ARRAY_SIZE = (AGENT_VIEW_SIZE, A... | true | true |
f71fc2a75dfc0689982cf24fdf8bcd85ccd1cfdc | 3,121 | py | Python | sponsors/notifications.py | geofft/pythondotorg | 4e6747acaffad21ba22d4611b58dccbf04a4ccac | [
"Apache-2.0"
] | 2 | 2021-04-06T16:22:51.000Z | 2021-05-04T13:48:42.000Z | sponsors/notifications.py | vishalsingha/pythondotorg | af59bc03f63cdea16b0f2bd98aae2dcec713c4c1 | [
"Apache-2.0"
] | 6 | 2021-03-19T15:57:15.000Z | 2021-12-13T20:50:11.000Z | sponsors/notifications.py | vishalsingha/pythondotorg | af59bc03f63cdea16b0f2bd98aae2dcec713c4c1 | [
"Apache-2.0"
] | 1 | 2021-08-21T10:36:44.000Z | 2021-08-21T10:36:44.000Z | from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.conf import settings
class BaseEmailSponsorshipNotification:
subject_template = None
message_template = None
email_context_keys = None
def get_subject(self, context):
return render_to_string... | 37.60241 | 82 | 0.779878 | from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.conf import settings
class BaseEmailSponsorshipNotification:
subject_template = None
message_template = None
email_context_keys = None
def get_subject(self, context):
return render_to_string... | true | true |
f71fc31f870e9d876d456cf459dc6a6019bc3ab0 | 336 | py | Python | py_001/py_contextmanager.py | shawn0915/python-study | 4f6d59ed93cb63295f6e67e661860e1f6a4b18c2 | [
"MIT"
] | null | null | null | py_001/py_contextmanager.py | shawn0915/python-study | 4f6d59ed93cb63295f6e67e661860e1f6a4b18c2 | [
"MIT"
] | null | null | null | py_001/py_contextmanager.py | shawn0915/python-study | 4f6d59ed93cb63295f6e67e661860e1f6a4b18c2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import codecs
from contextlib import contextmanager
@contextmanager
def Open(filename, mode, encoding='utf-8'):
fp = codecs.open(filename, mode, encoding)
try:
yield fp
finally:
fp.close()
data = u"context汉字测试"
with Open('data.txt', 'w') as f:
... | 17.684211 | 46 | 0.636905 |
import codecs
from contextlib import contextmanager
@contextmanager
def Open(filename, mode, encoding='utf-8'):
fp = codecs.open(filename, mode, encoding)
try:
yield fp
finally:
fp.close()
data = u"context汉字测试"
with Open('data.txt', 'w') as f:
f.write(data)
| true | true |
f71fc3e734e5af8996dc6c80f55020bcea9a755a | 2,085 | py | Python | simpleAPI/api/v1/serializers.py | Gleb-Stasuyk/simpleAPI | 9b30202915a4f144921b9bd5204f7bfac8b1201f | [
"MIT"
] | null | null | null | simpleAPI/api/v1/serializers.py | Gleb-Stasuyk/simpleAPI | 9b30202915a4f144921b9bd5204f7bfac8b1201f | [
"MIT"
] | null | null | null | simpleAPI/api/v1/serializers.py | Gleb-Stasuyk/simpleAPI | 9b30202915a4f144921b9bd5204f7bfac8b1201f | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from rest_framework import serializers
from companys.models import Company, News
from users.models import Profile
User = get_user_model()
class NewsSerializer(serializers.ModelSerializer):
class Meta:
model = News
fields = '__all__'
class Company... | 26.730769 | 88 | 0.655635 | from django.contrib.auth import get_user_model
from rest_framework import serializers
from companys.models import Company, News
from users.models import Profile
User = get_user_model()
class NewsSerializer(serializers.ModelSerializer):
class Meta:
model = News
fields = '__all__'
class Company... | true | true |
f71fc5a556957ba4ad43afcc5e2c620d83d7aa7c | 749 | py | Python | Server/tests/queries/test_leaderboards.py | Team-SeeTo/SeeTo-Backend | 19990cd6f4895e773eaa504f7b7a07ddbb5856e5 | [
"Apache-2.0"
] | 4 | 2018-06-18T06:50:12.000Z | 2018-11-15T00:08:24.000Z | Server/tests/queries/test_leaderboards.py | Team-SeeTo/SeeTo-Backend | 19990cd6f4895e773eaa504f7b7a07ddbb5856e5 | [
"Apache-2.0"
] | null | null | null | Server/tests/queries/test_leaderboards.py | Team-SeeTo/SeeTo-Backend | 19990cd6f4895e773eaa504f7b7a07ddbb5856e5 | [
"Apache-2.0"
] | null | null | null | from tests import BasicTestCase
class TestLeaderboards(BasicTestCase):
def test_leaderboards(self):
response = self.request(type="query",
call='leaderboards(token :"{0}")'.format(self.access_token),
body='''
..... | 37.45 | 92 | 0.419226 | from tests import BasicTestCase
class TestLeaderboards(BasicTestCase):
def test_leaderboards(self):
response = self.request(type="query",
call='leaderboards(token :"{0}")'.format(self.access_token),
body='''
..... | true | true |
f71fc6aac913f65673fbaf691c47f217c5bc9c25 | 536 | py | Python | imglatex/cli.py | odarbelaeze/imglatex | 8463531ae48dd4c2b4937ef4d27dbf74d6f732e3 | [
"MIT"
] | 2 | 2018-02-17T20:26:56.000Z | 2022-02-10T13:23:55.000Z | imglatex/cli.py | odarbelaeze/imglatex | 8463531ae48dd4c2b4937ef4d27dbf74d6f732e3 | [
"MIT"
] | 325 | 2018-03-18T15:28:48.000Z | 2022-03-28T04:19:18.000Z | imglatex/cli.py | odarbelaeze/imglatex | 8463531ae48dd4c2b4937ef4d27dbf74d6f732e3 | [
"MIT"
] | null | null | null | """Console script for imglatex."""
import click
from imglatex.imglatex import find_images, Image, Document
@click.command()
@click.argument('path', type=click.Path(exists=True))
@click.option('--prefix', default='.', help='Prefix for the image paths')
def main(path: click.Path, prefix: str):
"""Console script f... | 23.304348 | 73 | 0.671642 |
import click
from imglatex.imglatex import find_images, Image, Document
@click.command()
@click.argument('path', type=click.Path(exists=True))
@click.option('--prefix', default='.', help='Prefix for the image paths')
def main(path: click.Path, prefix: str):
document = Document(
list(Image(i, prefix) for... | true | true |
f71fc728dba3bae392f6f5d4e5b6e05cb75586f8 | 4,525 | py | Python | knox/auth.py | liradb2000/django-rest-knox | 2120bdb44173db121611387b9e1a2e8e358b0123 | [
"MIT"
] | null | null | null | knox/auth.py | liradb2000/django-rest-knox | 2120bdb44173db121611387b9e1a2e8e358b0123 | [
"MIT"
] | null | null | null | knox/auth.py | liradb2000/django-rest-knox | 2120bdb44173db121611387b9e1a2e8e358b0123 | [
"MIT"
] | null | null | null | try:
from hmac import compare_digest
except ImportError:
def compare_digest(a, b):
return a == b
import binascii
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentica... | 39.008621 | 113 | 0.643757 | try:
from hmac import compare_digest
except ImportError:
def compare_digest(a, b):
return a == b
import binascii
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from rest_framework import exceptions
from rest_framework.authentication import (
BaseAuthentica... | true | true |
f71fc7ba9f38450681a76a58e0a61f43125749ab | 10,698 | py | Python | codenames/players/codemaster_glove_lookahead.py | gohyun14/Game | 39e6e192590059daade40c95cc177acb0f3a581b | [
"MIT"
] | 1 | 2022-02-25T17:44:02.000Z | 2022-02-25T17:44:02.000Z | codenames/players/codemaster_glove_lookahead.py | gohyun14/Game | 39e6e192590059daade40c95cc177acb0f3a581b | [
"MIT"
] | null | null | null | codenames/players/codemaster_glove_lookahead.py | gohyun14/Game | 39e6e192590059daade40c95cc177acb0f3a581b | [
"MIT"
] | null | null | null | import scipy.spatial.distance
from nltk.stem import WordNetLemmatizer
from nltk.stem.lancaster import LancasterStemmer
from math import ceil
import numpy as np
import copy
import itertools
from players.codemaster import Codemaster
THRESHOLD = np.inf
class AICodemaster(Codemaster):
def __init__(self, brown_ic=Non... | 39.476015 | 123 | 0.570667 | import scipy.spatial.distance
from nltk.stem import WordNetLemmatizer
from nltk.stem.lancaster import LancasterStemmer
from math import ceil
import numpy as np
import copy
import itertools
from players.codemaster import Codemaster
THRESHOLD = np.inf
class AICodemaster(Codemaster):
def __init__(self, brown_ic=Non... | true | true |
f71fc8515d160a9327f631beba72fefeffeddf90 | 1,049 | py | Python | misc/pytorch_toolkit/machine_translation/core/dataset/text_container.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 256 | 2020-09-09T03:27:57.000Z | 2022-03-30T10:06:06.000Z | misc/pytorch_toolkit/machine_translation/core/dataset/text_container.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 604 | 2020-09-08T12:29:49.000Z | 2022-03-31T21:51:08.000Z | misc/pytorch_toolkit/machine_translation/core/dataset/text_container.py | dqawami/openvino_training_extensions | dddda1dfd651eaae2d59cecda84275b1b03bd0ad | [
"Apache-2.0"
] | 160 | 2020-09-09T14:06:07.000Z | 2022-03-30T14:50:48.000Z | """
Copyright (c) 2020 Intel Corporation
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 writin... | 32.78125 | 73 | 0.675882 | import io
from torch.utils.data import Dataset
from tqdm import tqdm
class TextContainer(Dataset):
def __init__(self, corpus):
self.data = []
with io.open(corpus, mode='r', encoding='utf-8') as f:
for line in tqdm(f):
self.data.append(line.strip())
def __len__(self)... | true | true |
f71fc8b40616224f0c26320e75087d6d233ed41a | 3,180 | py | Python | wurst/searching.py | pjamesjoyce/wurst | 95b37e72eaa18b33bdd83cd4a51d37d9eb4ae7ba | [
"BSD-2-Clause"
] | 1 | 2022-03-29T14:59:13.000Z | 2022-03-29T14:59:13.000Z | wurst/searching.py | pjamesjoyce/wurst | 95b37e72eaa18b33bdd83cd4a51d37d9eb4ae7ba | [
"BSD-2-Clause"
] | null | null | null | wurst/searching.py | pjamesjoyce/wurst | 95b37e72eaa18b33bdd83cd4a51d37d9eb4ae7ba | [
"BSD-2-Clause"
] | null | null | null | from .errors import MultipleResults, NoResults
def equals(field, value):
"""Return function where input ``field`` value is equal to ``value``"""
return lambda x: x.get(field) == value
def contains(field, value):
return lambda x: value in x.get(field)
def startswith(field, value):
return lambda x: ... | 30.576923 | 118 | 0.654088 | from .errors import MultipleResults, NoResults
def equals(field, value):
return lambda x: x.get(field) == value
def contains(field, value):
return lambda x: value in x.get(field)
def startswith(field, value):
return lambda x: x.get(field, '').startswith(value)
def either(*funcs):
return lambda x... | true | true |
f71fca16be9fa3da257d719ec7efdae5f61d8f68 | 4,100 | py | Python | sandbox/jorvis/generate_gff3_feature_identifiers.py | senjoro/biocode | 6697c17570126d99fb1cbeabf5b8322db006643d | [
"MIT"
] | 355 | 2015-01-15T18:11:20.000Z | 2022-03-26T19:23:30.000Z | sandbox/jorvis/generate_gff3_feature_identifiers.py | senjoro/biocode | 6697c17570126d99fb1cbeabf5b8322db006643d | [
"MIT"
] | 43 | 2015-03-20T08:40:14.000Z | 2022-03-09T22:37:38.000Z | sandbox/jorvis/generate_gff3_feature_identifiers.py | senjoro/biocode | 6697c17570126d99fb1cbeabf5b8322db006643d | [
"MIT"
] | 217 | 2015-01-29T08:40:33.000Z | 2022-03-26T19:23:45.000Z | #!/usr/bin/env python3
"""
This script is used to take any GFF3 file and re-generate feature identifiers within
it to match the convention used at IGS. This is:
$prefix.$type.$id.$version
The mode here defines what the identifier. For example, if using --mode=sequential for
an organism (--prefix) of b_microti,... | 29.496403 | 164 | 0.629268 |
import argparse
import os
import sys
from binascii import hexlify
from collections import defaultdict
from uuid import uuid4
from biocode import gff
equential = defaultdict(lambda: 1)
def main():
parser = argparse.ArgumentParser( description='Generates new identifiers in GFF3 files following the IGS identifie... | true | true |
f71fca6c7b717f1271683d16d11ce61370e99869 | 2,628 | py | Python | Apps/phforescoutcounteract/forescoutcounteract_consts.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 74 | 2019-10-22T02:00:53.000Z | 2022-03-15T12:56:13.000Z | Apps/phforescoutcounteract/forescoutcounteract_consts.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 375 | 2019-10-22T20:53:50.000Z | 2021-11-09T21:28:43.000Z | Apps/phforescoutcounteract/forescoutcounteract_consts.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 175 | 2019-10-23T15:30:42.000Z | 2021-11-05T21:33:31.000Z | # File: forescoutcounteract_consts.py
# Copyright (c) 2018-2021 Splunk Inc.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
# --
# Define your constants here
FS_DEX_HOST_ENDPOINT = '/fsapi/niCore/Hosts'
FS_DEX_LIST_ENDPOINT = '/fsapi/niCore/Lists'
FS_DEX_TEST_CONNECTIVITY = \
"""... | 36.5 | 117 | 0.619102 |
FS_DEX_HOST_ENDPOINT = '/fsapi/niCore/Hosts'
FS_DEX_LIST_ENDPOINT = '/fsapi/niCore/Lists'
FS_DEX_TEST_CONNECTIVITY = \
"""<?xml version="1.0" encoding="UTF-8"?>
<FSAPI TYPE="request" API_VERSION="1.0">
<TRANSACTION TYPE="update">
<OPTIONS CREATE_NEW_HOST="true"/>
<HOST_KEY N... | true | true |
f71fcd6b02e4155fea4b2f52039a9ce2c32ad6f6 | 7,009 | py | Python | nmeta2dpae/tc_policy_dpae.py | mattjhayes/nmeta2-dpae | f441d78f0cdbd63495d4f96cddb462b801d82925 | [
"Apache-2.0"
] | 1 | 2016-03-19T20:42:49.000Z | 2016-03-19T20:42:49.000Z | nmeta2dpae/tc_policy_dpae.py | mattjhayes/nmeta2-dpae | f441d78f0cdbd63495d4f96cddb462b801d82925 | [
"Apache-2.0"
] | 2 | 2016-04-09T01:17:39.000Z | 2016-04-09T01:30:58.000Z | nmeta2dpae/tc_policy_dpae.py | mattjhayes/nmeta2-dpae | f441d78f0cdbd63495d4f96cddb462b801d82925 | [
"Apache-2.0"
] | 4 | 2016-05-04T08:42:29.000Z | 2021-07-16T02:11:40.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 40.75 | 79 | 0.612356 |
import logging
import logging.handlers
import coloredlogs
import sys
import yaml
IDENTITY_KEYS = ('arp',
'lldp',
'dns',
'dhcp')
class TCPolicy(object):
def __init__(self, _config):
_logging_level_s = _config.get_value \
... | true | true |
f71fcd8293089c972b431387d1197b53dd7b564d | 516 | py | Python | src/event_representations.py | ATTPC/VAE-event-classification | aae331d44bffffec2ca8a6cdef71208899db0052 | [
"MIT"
] | null | null | null | src/event_representations.py | ATTPC/VAE-event-classification | aae331d44bffffec2ca8a6cdef71208899db0052 | [
"MIT"
] | 2 | 2018-12-20T20:10:52.000Z | 2019-02-04T17:44:01.000Z | src/event_representations.py | ATTPC/VAE-event-classification | aae331d44bffffec2ca8a6cdef71208899db0052 | [
"MIT"
] | null | null | null | import numpy as np
def make_histograms(x, bins=40, interval=[1e-1, 1]):
intervals = np.linspace(interval[0], interval[1], bins)
flat_x = x.reshape((x.shape[0], -1))
hist_x = np.zeros((x.shape[0], bins))
for i in range(1, bins):
mask = flat_x <= intervals[i]
mask = np.logical_and(mask, f... | 28.666667 | 60 | 0.604651 | import numpy as np
def make_histograms(x, bins=40, interval=[1e-1, 1]):
intervals = np.linspace(interval[0], interval[1], bins)
flat_x = x.reshape((x.shape[0], -1))
hist_x = np.zeros((x.shape[0], bins))
for i in range(1, bins):
mask = flat_x <= intervals[i]
mask = np.logical_and(mask, f... | true | true |
f71fce257398e75ef7291d3d8d8cd6d620bff9ed | 122 | py | Python | zpy/classes/bases/utility/pretty.py | yu-ichiro/zpy | 65e5ae7616d6e7fce91a03f20f663caa4af834b5 | [
"MIT"
] | null | null | null | zpy/classes/bases/utility/pretty.py | yu-ichiro/zpy | 65e5ae7616d6e7fce91a03f20f663caa4af834b5 | [
"MIT"
] | null | null | null | zpy/classes/bases/utility/pretty.py | yu-ichiro/zpy | 65e5ae7616d6e7fce91a03f20f663caa4af834b5 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class Pretty(ABC):
@abstractmethod
def __pretty__(self) -> str:
...
| 15.25 | 35 | 0.639344 | from abc import ABC, abstractmethod
class Pretty(ABC):
@abstractmethod
def __pretty__(self) -> str:
...
| true | true |
f71fcef13051a8d05b65c648d775148a97470b27 | 167,246 | py | Python | tensorflow/python/ops/nn_ops.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | 5 | 2019-01-13T16:15:25.000Z | 2019-07-07T16:17:32.000Z | tensorflow/python/ops/nn_ops.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/nn_ops.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.941493 | 96 | 0.668919 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numbers
import numpy as np
from tensorflow.python.compat import compat
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.f... | true | true |
f71fd03a67d84d601549326e242f921bbfd460d7 | 3,974 | py | Python | alipay/aop/api/request/ZhimaCreditEpProductCodeQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/ZhimaCreditEpProductCodeQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/ZhimaCreditEpProductCodeQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCreditEpProductCodeQueryModel import ZhimaCreditEpProductCodeQueryModel
class ZhimaCreditEpProductCodeQueryRequest(object):
... | 27.406897 | 148 | 0.64469 |
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCreditEpProductCodeQueryModel import ZhimaCreditEpProductCodeQueryModel
class ZhimaCreditEpProductCodeQueryRequest(object):
def __init__(self, biz_model=None):
... | true | true |
f71fd0d406c540386851f557a8dd36be11fad94d | 37,269 | py | Python | pandas/core/indexes/datetimes.py | cgangwar11/pandas | 972f491cb7fdcc3c1c2cb9f05644128f13457f87 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-05T07:09:39.000Z | 2020-09-05T07:09:39.000Z | pandas/core/indexes/datetimes.py | cgangwar11/pandas | 972f491cb7fdcc3c1c2cb9f05644128f13457f87 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/datetimes.py | cgangwar11/pandas | 972f491cb7fdcc3c1c2cb9f05644128f13457f87 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | from datetime import date, datetime, time, timedelta, tzinfo
import operator
from typing import Optional
import warnings
import numpy as np
from pandas._libs import NaT, Period, Timestamp, index as libindex, lib
from pandas._libs.tslibs import (
Resolution,
ints_to_pydatetime,
parsing,
timezones,
... | 33.395161 | 96 | 0.584937 | from datetime import date, datetime, time, timedelta, tzinfo
import operator
from typing import Optional
import warnings
import numpy as np
from pandas._libs import NaT, Period, Timestamp, index as libindex, lib
from pandas._libs.tslibs import (
Resolution,
ints_to_pydatetime,
parsing,
timezones,
... | true | true |
f71fd14cad832cbba2759947ed66a936ca0786bb | 5,432 | py | Python | src/python/sim_doc.py | csiu/kick | 0ebc9166074b702fc8b5835685ad102957ab349c | [
"MIT"
] | null | null | null | src/python/sim_doc.py | csiu/kick | 0ebc9166074b702fc8b5835685ad102957ab349c | [
"MIT"
] | null | null | null | src/python/sim_doc.py | csiu/kick | 0ebc9166074b702fc8b5835685ad102957ab349c | [
"MIT"
] | null | null | null | import sys
sys.path.append("/Users/csiu/repo/kick/src/python")
import argparse
import custom
import pandas as pd
import numpy as np
import re
import os
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.utils.extmath import randomized_s... | 30.01105 | 97 | 0.60475 | import sys
sys.path.append("/Users/csiu/repo/kick/src/python")
import argparse
import custom
import pandas as pd
import numpy as np
import re
import os
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.utils.extmath import randomized_s... | true | true |
f71fd21c199e5a31cb8e95fea4d6ad447b4eb6cf | 2,082 | py | Python | adsputils/tests/test_init.py | adsabs/ADSPipelineUtils | eb8cc988f57c19a256ebc8802cc2a812d5279d12 | [
"MIT"
] | null | null | null | adsputils/tests/test_init.py | adsabs/ADSPipelineUtils | eb8cc988f57c19a256ebc8802cc2a812d5279d12 | [
"MIT"
] | 36 | 2017-06-23T20:29:22.000Z | 2020-03-18T15:04:27.000Z | adsputils/tests/test_init.py | adsabs/ADSPipelineUtils | eb8cc988f57c19a256ebc8802cc2a812d5279d12 | [
"MIT"
] | 12 | 2017-06-21T18:10:57.000Z | 2021-11-01T19:13:32.000Z | # -*- coding: utf-8 -*-
import adsputils
import unittest
import os
import json
import time
from inspect import currentframe, getframeinfo
from adsputils.exceptions import UnicodeHandlerError
def _read_file(fpath):
with open(fpath, 'r') as fi:
return fi.read()
class TestInit(unittest.TestCase):
def t... | 28.135135 | 87 | 0.604707 |
import adsputils
import unittest
import os
import json
import time
from inspect import currentframe, getframeinfo
from adsputils.exceptions import UnicodeHandlerError
def _read_file(fpath):
with open(fpath, 'r') as fi:
return fi.read()
class TestInit(unittest.TestCase):
def test_logging(self):
... | true | true |
f71fd223ff855bd602d59319796b96fc483982ca | 20,550 | py | Python | log_complete_bcl2/model_76.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete_bcl2/model_76.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete_bcl2/model_76.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.138889 | 798 | 0.804136 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
f71fd3f3075081a6f7b219e41391ee28001ad25c | 2,073 | py | Python | codes/poop/fizzbuzz.py | cassiobotaro/go_slides | 1e9bedff22acc78a39cc054c0de432ef80c2df7b | [
"MIT"
] | 2 | 2019-02-27T14:45:39.000Z | 2021-09-27T03:46:20.000Z | codes/poop/fizzbuzz.py | cassiobotaro/go_slides | 1e9bedff22acc78a39cc054c0de432ef80c2df7b | [
"MIT"
] | null | null | null | codes/poop/fizzbuzz.py | cassiobotaro/go_slides | 1e9bedff22acc78a39cc054c0de432ef80c2df7b | [
"MIT"
] | 2 | 2017-04-13T14:42:31.000Z | 2021-09-27T03:46:22.000Z | # smalltalk infected fizzbuzz version
from forbiddenfruit import curse
from collections import deque
def if_true(self, block):
# simulate blocks using functions
self and block()
# close circuit when object is truthy
return self
def if_false(self, block):
# simulate blocks using functions
not... | 25.280488 | 75 | 0.670043 |
from forbiddenfruit import curse
from collections import deque
def if_true(self, block):
self and block()
return self
def if_false(self, block):
not self and block()
return self
def println(self):
print(self)
def do(self, block):
deque(map(block, self), maxlen=0)
... | true | true |
f71fd4a1f731db04f57e93f442976ca80b5b4b5d | 8,349 | py | Python | s2e_env/tui/tui.py | michaelbrownuc/s2e-env | 4bd6a45bf1ec9456ed5acf5047b6aac3fcd19683 | [
"BSD-3-Clause"
] | null | null | null | s2e_env/tui/tui.py | michaelbrownuc/s2e-env | 4bd6a45bf1ec9456ed5acf5047b6aac3fcd19683 | [
"BSD-3-Clause"
] | null | null | null | s2e_env/tui/tui.py | michaelbrownuc/s2e-env | 4bd6a45bf1ec9456ed5acf5047b6aac3fcd19683 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017 Cyberhaven
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sub... | 26.674121 | 78 | 0.573602 |
import curses
import time
_s_screen = None
class Form:
def __init__(self, parent, x, y, w=None, h=None):
self._children = []
self._parent = parent
self._x = x
self._y = y
self._h = h
self._w = w
self._vcenter, self._hcenter = False, False
... | true | true |
f71fd745dc747e5cd621bba11088fb4afbc2acb3 | 1,092 | py | Python | jmatcher/users/migrations/0004_auto_20170303_2141.py | jamesaud/se1-group4 | 5280b13dff33e72ce717318a8dd78a06cd6effb3 | [
"MIT"
] | 1 | 2021-09-09T15:43:09.000Z | 2021-09-09T15:43:09.000Z | jmatcher/users/migrations/0004_auto_20170303_2141.py | jamesaud/se1-group4 | 5280b13dff33e72ce717318a8dd78a06cd6effb3 | [
"MIT"
] | null | null | null | jmatcher/users/migrations/0004_auto_20170303_2141.py | jamesaud/se1-group4 | 5280b13dff33e72ce717318a8dd78a06cd6effb3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-03 21:41
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_remove_student_student_name'),
]
ope... | 30.333333 | 150 | 0.57967 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_remove_student_student_name'),
]
operations = [
migrations.CreateModel(
name='Skill',
... | true | true |
f71fd8d00f312300adb54ea7c3dae8e0ed739a61 | 9,839 | py | Python | datasets/preprocess/mpi_inf_3dhp.py | virgile-hernicot/SPIN | 21871e3d333ef37866402ae21498b331aa771b2d | [
"BSD-3-Clause"
] | 555 | 2019-09-30T01:03:23.000Z | 2022-03-30T03:56:09.000Z | datasets/preprocess/mpi_inf_3dhp.py | virgile-hernicot/SPIN | 21871e3d333ef37866402ae21498b331aa771b2d | [
"BSD-3-Clause"
] | 110 | 2019-10-01T05:51:07.000Z | 2022-03-23T13:51:05.000Z | datasets/preprocess/mpi_inf_3dhp.py | virgile-hernicot/SPIN | 21871e3d333ef37866402ae21498b331aa771b2d | [
"BSD-3-Clause"
] | 158 | 2019-09-30T07:06:48.000Z | 2022-03-22T02:32:03.000Z | import os
import sys
import cv2
import glob
import h5py
import json
import numpy as np
import scipy.io as sio
import scipy.misc
from .read_openpose import read_openpose
def read_calibration(calib_file, vid_list):
Ks, Rs, Ts = [], [], []
file = open(calib_file, 'r')
content = file.readlines()
for vid_i ... | 39.514056 | 112 | 0.468035 | import os
import sys
import cv2
import glob
import h5py
import json
import numpy as np
import scipy.io as sio
import scipy.misc
from .read_openpose import read_openpose
def read_calibration(calib_file, vid_list):
Ks, Rs, Ts = [], [], []
file = open(calib_file, 'r')
content = file.readlines()
for vid_i ... | true | true |
f71fd8ed4a60f1f0cb0713800b0c028bb7bc4489 | 16,140 | py | Python | desktop/core/ext-py/pysaml2-4.4.0/src/saml2/cert.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 3 | 2018-01-29T14:16:02.000Z | 2019-02-05T21:33:05.000Z | desktop/core/ext-py/pysaml2-4.4.0/src/saml2/cert.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 4 | 2021-03-11T04:02:00.000Z | 2022-03-27T08:31:56.000Z | desktop/core/ext-py/pysaml2-4.4.0/src/saml2/cert.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2 | 2019-06-17T11:51:56.000Z | 2020-07-25T08:29:56.000Z | __author__ = 'haho0032'
import base64
import datetime
import dateutil.parser
import pytz
import six
from OpenSSL import crypto
from os.path import join
from os import remove
from Cryptodome.Util import asn1
class WrongInput(Exception):
pass
class CertificateError(Exception):
pass
class PayloadError(Except... | 43.621622 | 98 | 0.495291 | __author__ = 'haho0032'
import base64
import datetime
import dateutil.parser
import pytz
import six
from OpenSSL import crypto
from os.path import join
from os import remove
from Cryptodome.Util import asn1
class WrongInput(Exception):
pass
class CertificateError(Exception):
pass
class PayloadError(Except... | true | true |
f71fd916fcc0b6fd5407ff0c3b8ac492320273d7 | 26,028 | py | Python | tf_rl_tutorial/models.py | 4k4xs4pH1r3/tf_rl_tutorial | c58d10c60cfd79b2e0661b4a49cccae8d4584c57 | [
"Apache-2.0"
] | 40 | 2016-03-09T03:03:08.000Z | 2021-09-11T21:44:12.000Z | tf_rl_tutorial/models.py | 4k4xs4pH1r3/tf_rl_tutorial | c58d10c60cfd79b2e0661b4a49cccae8d4584c57 | [
"Apache-2.0"
] | 1 | 2018-05-08T13:45:43.000Z | 2018-05-08T13:45:43.000Z | tf_rl_tutorial/models.py | 4k4xs4pH1r3/tf_rl_tutorial | c58d10c60cfd79b2e0661b4a49cccae8d4584c57 | [
"Apache-2.0"
] | 17 | 2016-03-17T14:57:11.000Z | 2021-06-04T16:24:48.000Z | # Copyright 2016 Mandiant, A FireEye Company
# Authors: Brian Jones
# License: Apache 2.0
''' Model classes for "Relational Learning with TensorFlow" tutorial '''
import numpy as np
import tensorflow as tf
from .util import ContrastiveTrainingProvider
def least_squares_objective(output, target, add_bias=True):
... | 47.67033 | 96 | 0.643807 |
import numpy as np
import tensorflow as tf
from .util import ContrastiveTrainingProvider
def least_squares_objective(output, target, add_bias=True):
y = output
if add_bias:
bias = tf.Variable([0.0])
y = output + bias
loss = tf.reduce_sum(tf.square(y - target))
return y, loss
de... | true | true |
f71fd969d3ac6dc91ff8442595549e245b3a9430 | 1,059 | py | Python | salvia/wallet/payment.py | Salvia-Network/salvia-blockchain | b0ce4b9f75c2fc354941b45eb468ffcf917ead30 | [
"Apache-2.0"
] | 6 | 2021-09-13T17:20:49.000Z | 2022-02-09T04:31:47.000Z | salvia/wallet/payment.py | Salvia-Network/salvia-blockchain | b0ce4b9f75c2fc354941b45eb468ffcf917ead30 | [
"Apache-2.0"
] | 21 | 2021-09-20T00:56:54.000Z | 2022-03-22T01:12:12.000Z | salvia/wallet/payment.py | Salvia-Network/salvia-blockchain | b0ce4b9f75c2fc354941b45eb468ffcf917ead30 | [
"Apache-2.0"
] | 9 | 2021-09-13T17:54:04.000Z | 2022-03-15T08:38:35.000Z | from dataclasses import dataclass
from typing import List
from salvia.types.blockchain_format.sized_bytes import bytes32
from salvia.types.blockchain_format.program import Program
from salvia.util.ints import uint64
# This class is supposed to correspond to a CREATE_COIN condition
@dataclass(frozen=True)
class Paym... | 31.147059 | 86 | 0.705382 | from dataclasses import dataclass
from typing import List
from salvia.types.blockchain_format.sized_bytes import bytes32
from salvia.types.blockchain_format.program import Program
from salvia.util.ints import uint64
@dataclass(frozen=True)
class Payment:
puzzle_hash: bytes32
amount: uint64
memos: List[... | true | true |
f71fd999a54a3748a94533f9d632879d0495dbcd | 1,271 | py | Python | checklink/parse/__init__.py | zombie110year/find_dead_link | 565ec99c0fcbecaa4f7d82006bc9d58d0c05fa06 | [
"MIT"
] | null | null | null | checklink/parse/__init__.py | zombie110year/find_dead_link | 565ec99c0fcbecaa4f7d82006bc9d58d0c05fa06 | [
"MIT"
] | null | null | null | checklink/parse/__init__.py | zombie110year/find_dead_link | 565ec99c0fcbecaa4f7d82006bc9d58d0c05fa06 | [
"MIT"
] | null | null | null | """
Text Parsers to find url from content.
Every url item should contain:
- url
- location(`filepath:row:column`)
"""
from abc import abstractmethod
from typing import List
class Link:
def __init__(self, url: str, path: str, row: int, column: int):
"""init link object
:param str url: link's hre... | 21.183333 | 76 | 0.601888 | from abc import abstractmethod
from typing import List
class Link:
def __init__(self, url: str, path: str, row: int, column: int):
self.__url = url
self.__path = path
self.__row = row
self.__column = column
@property
def url(self) -> str:
return self.__url
@pr... | true | true |
f71fd9b490090c7c03e0f828032d2a989edaca88 | 3,415 | py | Python | components/studio/projects/models.py | MuhammadNaumanAbid/stackn | 484501efda19f8f9c9c088bcf6095060c925d3b1 | [
"Apache-2.0"
] | null | null | null | components/studio/projects/models.py | MuhammadNaumanAbid/stackn | 484501efda19f8f9c9c088bcf6095060c925d3b1 | [
"Apache-2.0"
] | null | null | null | components/studio/projects/models.py | MuhammadNaumanAbid/stackn | 484501efda19f8f9c9c088bcf6095060c925d3b1 | [
"Apache-2.0"
] | null | null | null | import base64
from django.db import models
from django.contrib.auth.models import User
from django.utils.text import slugify
import string
import random
DEFAULT_ENVIRONMENT_ID = 1
class Flavor(models.Model):
name = models.CharField(max_length=512)
slug = models.CharField(max_length=512)
cpu = models.Te... | 34.846939 | 120 | 0.703075 | import base64
from django.db import models
from django.contrib.auth.models import User
from django.utils.text import slugify
import string
import random
DEFAULT_ENVIRONMENT_ID = 1
class Flavor(models.Model):
name = models.CharField(max_length=512)
slug = models.CharField(max_length=512)
cpu = models.Te... | true | true |
f71fdbd179d815f56f9c409701685cd66a7005c3 | 23,154 | py | Python | yuu/ext/abematv.py | soltia48/yuu | 30d2fcf9427cbbea930d01baef337b64ad7fb05b | [
"BSD-3-Clause"
] | null | null | null | yuu/ext/abematv.py | soltia48/yuu | 30d2fcf9427cbbea930d01baef337b64ad7fb05b | [
"BSD-3-Clause"
] | null | null | null | yuu/ext/abematv.py | soltia48/yuu | 30d2fcf9427cbbea930d01baef337b64ad7fb05b | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import hmac
import json
import logging
import os
import re
import struct
import tempfile
import time
import uuid
from base64 import urlsafe_b64encode
from binascii import unhexlify
import m3u8
from Crypto.Cipher import AES
from tqdm import tqdm
def is_channel(url):
url = re.findall('(slot)', url)
... | 38.914286 | 170 | 0.556319 | import hashlib
import hmac
import json
import logging
import os
import re
import struct
import tempfile
import time
import uuid
from base64 import urlsafe_b64encode
from binascii import unhexlify
import m3u8
from Crypto.Cipher import AES
from tqdm import tqdm
def is_channel(url):
url = re.findall('(slot)', url)
... | true | true |
f71fde1bd02fcc1f714d372b9d638e5ed8bbe7be | 4,468 | py | Python | data_steward/cdr_cleaner/cleaning_rules/deid/dateshift.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 16 | 2017-06-30T20:05:05.000Z | 2022-03-08T21:03:19.000Z | data_steward/cdr_cleaner/cleaning_rules/deid/dateshift.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 342 | 2017-06-23T21:37:40.000Z | 2022-03-30T16:44:16.000Z | data_steward/cdr_cleaner/cleaning_rules/deid/dateshift.py | lrwb-aou/curation | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | [
"MIT"
] | 33 | 2017-07-01T00:12:20.000Z | 2022-01-26T18:06:53.000Z | """
The basic date shifting rule..
Original Issue: DC-1005
This is an abstract class and cannot be directly instantiated. It must be
extended to be used.
"""
# Python Imports
import logging
from abc import abstractmethod
# Project imports
from cdr_cleaner.cleaning_rules.base_cleaning_rule import BaseCleaningRule
fr... | 34.90625 | 78 | 0.576321 |
import logging
from abc import abstractmethod
from cdr_cleaner.cleaning_rules.base_cleaning_rule import BaseCleaningRule
from common import JINJA_ENV
LOGGER = logging.getLogger(__name__)
SHIFT_EXP = JINJA_ENV.from_string("""
{{field_type}}_SUB( CAST({{field}} AS {{field_type}}), INTERVAL (
SELECT
shift... | true | true |
f71fde73faca108579365cdbb13033f096a89b4b | 37,146 | py | Python | conf_selection_and_DFT/PL_dft_library_201027.py | aspuru-guzik-group/kraken | 4eaad505c1343e6083032b4a3fda47e004e19734 | [
"MIT"
] | 3 | 2022-01-13T12:39:54.000Z | 2022-03-30T00:10:52.000Z | conf_selection_and_DFT/PL_dft_library_201027.py | aspuru-guzik-group/kraken | 4eaad505c1343e6083032b4a3fda47e004e19734 | [
"MIT"
] | null | null | null | conf_selection_and_DFT/PL_dft_library_201027.py | aspuru-guzik-group/kraken | 4eaad505c1343e6083032b4a3fda47e004e19734 | [
"MIT"
] | null | null | null | # 201005: rename/restructure .yml files for consistency with xtb-level data
# 201006: in read_conformer() fix error message when log files are missing
import os,re,itertools,time
#import pybel
#from openbabel import pybel
import numpy as np
import pandas as pd
import pathlib as pl
cwd = pl.Path.cwd()
import... | 57.324074 | 1,343 | 0.619959 |
import os,re,itertools,time
import numpy as np
import pandas as pd
import pathlib as pl
cwd = pl.Path.cwd()
import yaml
from yaml import CLoader as Loader
from yaml import CDumper as Dumper
from rdkit import Chem,Geometry
from rdkit.Chem import rdmolfiles, AllChem, rdMolAlign,rdmolops
from multiprocessi... | true | true |
f71fdf25a6bbbf3c2ecdf90eda58463aa369ca88 | 52,543 | py | Python | t5/seqio/dataset_providers.py | dptam/text-to-text-transfer-transformer | 3662823b126ebf39d9d8ed147a8af0c6973f0ba9 | [
"Apache-2.0"
] | null | null | null | t5/seqio/dataset_providers.py | dptam/text-to-text-transfer-transformer | 3662823b126ebf39d9d8ed147a8af0c6973f0ba9 | [
"Apache-2.0"
] | null | null | null | t5/seqio/dataset_providers.py | dptam/text-to-text-transfer-transformer | 3662823b126ebf39d9d8ed147a8af0c6973f0ba9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The T5 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 36.161734 | 107 | 0.671888 |
import abc
import collections
import inspect
import json
import os
import re
from typing import Any, Callable, Iterable, Mapping, MutableMapping, Optional, Sequence, Tuple, Type, Union
from absl import logging
import dataclasses
import numpy as np
from packaging import version
from t5.seqio import util... | true | true |
f71fdf38821c8803ae681fd71c4c71d7da8b1c90 | 2,037 | py | Python | airflow/migrations/versions/0090_30867afad44a_rename_concurrency_column_in_dag_table_.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 8,092 | 2016-04-27T20:32:29.000Z | 2019-01-05T07:39:33.000Z | airflow/migrations/versions/0090_30867afad44a_rename_concurrency_column_in_dag_table_.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 2,961 | 2016-05-05T07:16:16.000Z | 2019-01-05T08:47:59.000Z | airflow/migrations/versions/0090_30867afad44a_rename_concurrency_column_in_dag_table_.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 3,546 | 2016-05-04T20:33:16.000Z | 2019-01-05T05:14:26.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 31.338462 | 88 | 0.691703 |
import sqlalchemy as sa
from alembic import op
revision = '30867afad44a'
down_revision = 'e9304a3141f0'
branch_labels = None
depends_on = None
airflow_version = '2.2.0'
def upgrade():
conn = op.get_bind()
is_sqlite = bool(conn.dialect.name == "sqlite")
if is_sqlite:
op.execut... | true | true |
f71fdf687002e4d434788ab435b395447a70728b | 228 | py | Python | dstlib/node.py | Algebra7/dstlib | 3f891fb48c8c00caf89255c45a1b41f76331d252 | [
"MIT"
] | 1 | 2021-07-27T08:22:29.000Z | 2021-07-27T08:22:29.000Z | dstlib/node.py | Algebra7/dstlib | 3f891fb48c8c00caf89255c45a1b41f76331d252 | [
"MIT"
] | null | null | null | dstlib/node.py | Algebra7/dstlib | 3f891fb48c8c00caf89255c45a1b41f76331d252 | [
"MIT"
] | null | null | null | class Node:
"""Class for storing linked list node."""
def __init__(self, element, next_pointer, prev_pointer=None):
self._element = element
self._next = next_pointer
self._prev = prev_pointer | 32.571429 | 65 | 0.653509 | class Node:
def __init__(self, element, next_pointer, prev_pointer=None):
self._element = element
self._next = next_pointer
self._prev = prev_pointer | true | true |
f71fdf8b98012c19be34962342155bc04ff638eb | 25,034 | py | Python | garnets.py | seanth/garnets | 3ff37bcbf095df14586cccb39a52bcf7b221c8ee | [
"MIT"
] | 1 | 2022-02-25T14:32:34.000Z | 2022-02-25T14:32:34.000Z | garnets.py | seanth/garnets | 3ff37bcbf095df14586cccb39a52bcf7b221c8ee | [
"MIT"
] | null | null | null | garnets.py | seanth/garnets | 3ff37bcbf095df14586cccb39a52bcf7b221c8ee | [
"MIT"
] | 2 | 2020-09-02T17:18:33.000Z | 2022-02-25T14:32:48.000Z | import logging
import random
from math import sqrt, log
from stellar_system import Star
from stellar_system import Planetesimal
from stellar_system import Protoplanet
from stellar_system import Protomoon
from stellar_system import Planet
from stellar_system import Orbit
from accrete import CircumstellarDisk
from consta... | 40.247588 | 284 | 0.533874 | import logging
import random
from math import sqrt, log
from stellar_system import Star
from stellar_system import Planetesimal
from stellar_system import Protoplanet
from stellar_system import Protomoon
from stellar_system import Planet
from stellar_system import Orbit
from accrete import CircumstellarDisk
from consta... | true | true |
f71fe0dc7aac7d9afad4c1f08c6e9b94fde74e57 | 4,160 | py | Python | vivisect/extensions/example_gui_extension.py | bat-serjo/vivisect | f60934a2c8c51c7acdba52a65756e717a108a440 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vivisect/extensions/example_gui_extension.py | bat-serjo/vivisect | f60934a2c8c51c7acdba52a65756e717a108a440 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vivisect/extensions/example_gui_extension.py | bat-serjo/vivisect | f60934a2c8c51c7acdba52a65756e717a108a440 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | try:
from PyQt5.QtWidgets import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog
from PyQt5 import QtCore
except:
from PyQt4.QtGui import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog
from PyQt4 import QtCore
from vqt.main import idlethread
from vqt.basics import VBox
... | 31.755725 | 111 | 0.665625 | try:
from PyQt5.QtWidgets import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog
from PyQt5 import QtCore
except:
from PyQt4.QtGui import QToolBar, QLabel, QPushButton, QTextEdit, QWidget, QInputDialog
from PyQt4 import QtCore
from vqt.main import idlethread
from vqt.basics import VBox
... | true | true |
f71fe1a680e38a876089f6c92424e564085015cd | 728 | py | Python | tests/test_bit.py | robertchase/aiomysql | 80236fca02c70cd693cb02112646ca14f2c7e2be | [
"MIT"
] | null | null | null | tests/test_bit.py | robertchase/aiomysql | 80236fca02c70cd693cb02112646ca14f2c7e2be | [
"MIT"
] | null | null | null | tests/test_bit.py | robertchase/aiomysql | 80236fca02c70cd693cb02112646ca14f2c7e2be | [
"MIT"
] | 1 | 2021-04-30T14:11:42.000Z | 2021-04-30T14:11:42.000Z | """test Bit operations"""
import pytest
from aiomysql.bit import Bit
@pytest.mark.parametrize(
'length, value, expected', (
(10, None, ValueError),
(10, 1, 1),
(10, '123', TypeError),
(10, '0', 0),
(10, '1', 1),
(10, '010', 2),
(10, '1010', 10),
(10... | 22.060606 | 43 | 0.54533 | import pytest
from aiomysql.bit import Bit
@pytest.mark.parametrize(
'length, value, expected', (
(10, None, ValueError),
(10, 1, 1),
(10, '123', TypeError),
(10, '0', 0),
(10, '1', 1),
(10, '010', 2),
(10, '1010', 10),
(10, '01000000000', ValueErro... | true | true |
f71fe27393e1a3a75142186240ffddd9c0d963a4 | 15,812 | py | Python | contrib/experimental/input/osx.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 15 | 2015-01-21T12:29:01.000Z | 2018-12-09T09:17:33.000Z | contrib/experimental/input/osx.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | null | null | null | contrib/experimental/input/osx.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 9 | 2015-12-12T09:12:46.000Z | 2021-12-26T13:29:14.000Z | #!/usr/bin/env python
"""
"""
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import ctypes
import pyglet
from pyglet.libs.darwin import carbon, _oscheck, create_cfstring
from pyglet.libs.darwin.constants import *
import input
import usage
# non-broken c_void_p
void_p = ctypes.POINTER(ctypes.c_int)
cl... | 34.982301 | 84 | 0.544397 |
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import ctypes
import pyglet
from pyglet.libs.darwin import carbon, _oscheck, create_cfstring
from pyglet.libs.darwin.constants import *
import input
import usage
void_p = ctypes.POINTER(ctypes.c_int)
class CFUUIDBytes(ctypes.Structure):
_fields_ = ... | true | true |
f71fe39b002b6987bd56fdc8f822aa4a1ab3f554 | 548 | py | Python | config_parser.py | benkelaci/qrcode_medicinedispenser | 41cee011dc0e9ab5d1ef0738efd5e1ea11c13d0a | [
"MIT"
] | null | null | null | config_parser.py | benkelaci/qrcode_medicinedispenser | 41cee011dc0e9ab5d1ef0738efd5e1ea11c13d0a | [
"MIT"
] | null | null | null | config_parser.py | benkelaci/qrcode_medicinedispenser | 41cee011dc0e9ab5d1ef0738efd5e1ea11c13d0a | [
"MIT"
] | null | null | null | import json
class Struct(object):
def __init__(self, data):
for name, value in data.items():
setattr(self, name, self._wrap(value))
def _wrap(self, value):
if isinstance(value, (tuple, list, set, frozenset)):
return type(value)([self._wrap(v) for v in value... | 27.4 | 71 | 0.616788 | import json
class Struct(object):
def __init__(self, data):
for name, value in data.items():
setattr(self, name, self._wrap(value))
def _wrap(self, value):
if isinstance(value, (tuple, list, set, frozenset)):
return type(value)([self._wrap(v) for v in value... | true | true |
f71fe39bd8323e42c4bdd0221f1966de94ab7729 | 904 | py | Python | examples/sawyer/moveit_planning.py | gujralsanyam22/pyrobot | a0448714857b684d8b280f710e9304988524d2e0 | [
"MIT"
] | 2,150 | 2019-06-12T20:55:41.000Z | 2022-03-21T07:14:51.000Z | examples/sawyer/moveit_planning.py | gujralsanyam22/pyrobot | a0448714857b684d8b280f710e9304988524d2e0 | [
"MIT"
] | 124 | 2019-06-22T17:12:27.000Z | 2022-02-26T11:43:13.000Z | examples/sawyer/moveit_planning.py | gujralsanyam22/pyrobot | a0448714857b684d8b280f710e9304988524d2e0 | [
"MIT"
] | 329 | 2019-06-13T03:03:54.000Z | 2022-03-30T07:04:55.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Example for commanding robot with position control using moveit planner
"""
import time
from pyrobot import Robot
def main():
targe... | 21.52381 | 71 | 0.622788 |
import time
from pyrobot import Robot
def main():
target_joints = [
[0.704, -0.455, -0.159, 1.395, -1.240, 1.069, 2.477],
[-0.341, -0.384, -0.018, 1.533, -0.977, -1.492, -1.084],
]
config = dict(moveit_planner_type="ESTkConfigDefault")
bot = Robot(
"sawyer",
use... | true | true |
f71fe3a7ec4b148032db722f5c53b2c067b9a249 | 1,863 | py | Python | random_colors.py | electric-blue-green/trinket | 82e1e265934252c0cf3b2fa72f9bc1d60a35ac93 | [
"Unlicense"
] | 1 | 2021-06-05T03:12:36.000Z | 2021-06-05T03:12:36.000Z | random_colors.py | aejb/trinket | 82e1e265934252c0cf3b2fa72f9bc1d60a35ac93 | [
"Unlicense"
] | 1 | 2018-02-26T11:22:50.000Z | 2018-02-26T11:22:50.000Z | random_colors.py | electric-blue-green/trinket | 82e1e265934252c0cf3b2fa72f9bc1d60a35ac93 | [
"Unlicense"
] | null | null | null | import board
import busio
import time
import random
dotstar = busio.SPI(board.APA102_SCK, board.APA102_MOSI)
#colors = [1, 128, 244] # set colors all to 1
colors = [random.randint(3, 240), random.randint(3, 240), random.randint(3, 240), ] # selects random start color in "safe zone"
steps = [1, 3, 4] # se... | 56.454545 | 131 | 0.574342 | import board
import busio
import time
import random
dotstar = busio.SPI(board.APA102_SCK, board.APA102_MOSI)
dint(3, 240), random.randint(3, 240), random.randint(3, 240), ]
steps = [1, 3, 4]
steps = [random.randint(1, 5), random.randint(1, 5), random.randint(1, 5)]
print("INIT") etColor(index,... | true | true |
f71fe485cdc1d845da328b9bf8355e5b4665fa3d | 393 | py | Python | project-euler/py/e6.py | aaycee/aaycee.github.io | b609a869c5c9d02f7cbc1798b643ec083475f741 | [
"MIT"
] | null | null | null | project-euler/py/e6.py | aaycee/aaycee.github.io | b609a869c5c9d02f7cbc1798b643ec083475f741 | [
"MIT"
] | null | null | null | project-euler/py/e6.py | aaycee/aaycee.github.io | b609a869c5c9d02f7cbc1798b643ec083475f741 | [
"MIT"
] | null | null | null | # Akachukwu Obi, 2018
# Project Euler #6
# see .js file for build up
def diffOfSumOfSquares(max):
sumOfNumbers = max * (max + 1) / 2 # sum of n natural numbers is n(n + 1)/2
sumOfSquares = (max / 6.0) * (2 * max + 1) * (max + 1) # I used 6.0 to avoid getting a math.floor situation in puthon2.7
return sumOfNumbers ... | 35.727273 | 121 | 0.689567 |
def diffOfSumOfSquares(max):
sumOfNumbers = max * (max + 1) / 2
sumOfSquares = (max / 6.0) * (2 * max + 1) * (max + 1)
return sumOfNumbers * sumOfNumbers - sumOfSquares
print(diffOfSumOfSquares(100)) | true | true |
f71fe4adf7dd0cb5bea1c0b3a038207a017240b9 | 250 | py | Python | experiments_approximate/experiments/create_dico_alphacsc.py | bmalezieux/unrolled_dl | 5854a6991e44db025a99a9f0d38be6b1e669aa83 | [
"MIT"
] | null | null | null | experiments_approximate/experiments/create_dico_alphacsc.py | bmalezieux/unrolled_dl | 5854a6991e44db025a99a9f0d38be6b1e669aa83 | [
"MIT"
] | null | null | null | experiments_approximate/experiments/create_dico_alphacsc.py | bmalezieux/unrolled_dl | 5854a6991e44db025a99a9f0d38be6b1e669aa83 | [
"MIT"
] | null | null | null | import numpy as np
atoms_to_save = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 15, 18])
u_cdl = np.load("u_cdl.npy")
v_cdl = np.load("v_cdl.npy")
np.save("u_cdl_modified.npy", u_cdl[atoms_to_save])
np.save("v_cdl_modified.npy", v_cdl[atoms_to_save])
| 25 | 65 | 0.68 | import numpy as np
atoms_to_save = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 15, 18])
u_cdl = np.load("u_cdl.npy")
v_cdl = np.load("v_cdl.npy")
np.save("u_cdl_modified.npy", u_cdl[atoms_to_save])
np.save("v_cdl_modified.npy", v_cdl[atoms_to_save])
| true | true |
f71fead294ee942753789629c9a72d7384c394a0 | 2,087 | py | Python | main.py | KevHg/reddit-sentiment | 383407105957b8a582a524fa29b9f21d7b2cbd23 | [
"MIT"
] | 3 | 2020-12-22T09:03:15.000Z | 2021-05-13T18:17:44.000Z | main.py | KevHg/reddit-sentiment | 383407105957b8a582a524fa29b9f21d7b2cbd23 | [
"MIT"
] | 3 | 2020-11-11T15:33:13.000Z | 2021-12-13T20:18:41.000Z | main.py | KevHg/reddit-sentiment | 383407105957b8a582a524fa29b9f21d7b2cbd23 | [
"MIT"
] | 1 | 2021-02-18T19:56:09.000Z | 2021-02-18T19:56:09.000Z | import os
from scrapy.crawler import CrawlerProcess
import pandas as pd
import logging
import nltk
import json_reader
from sentiment_score import clean_text, calculate_sentiment_score
from reddit_scraper.reddit_scraper.spiders.reddit_post_scraper import RedditPostCrawler
if __name__ == '__main__':
# Initial setup... | 33.66129 | 117 | 0.661236 | import os
from scrapy.crawler import CrawlerProcess
import pandas as pd
import logging
import nltk
import json_reader
from sentiment_score import clean_text, calculate_sentiment_score
from reddit_scraper.reddit_scraper.spiders.reddit_post_scraper import RedditPostCrawler
if __name__ == '__main__':
logging.ge... | true | true |
f71feb945e7c962481692be8e2384e367a3c4bbd | 3,443 | py | Python | pollbot/models/reference.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 112 | 2019-06-11T17:52:57.000Z | 2022-03-18T00:05:21.000Z | pollbot/models/reference.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 91 | 2019-05-28T11:33:40.000Z | 2022-02-27T12:12:07.000Z | pollbot/models/reference.py | shubham-king/poll | 677e870bea36dffbf27f24e4cdeec892b40f7128 | [
"MIT"
] | 69 | 2019-07-10T16:58:06.000Z | 2022-03-30T22:09:44.000Z | """The sqlalchemy model for a polloption."""
from __future__ import annotations
from sqlalchemy import Column, ForeignKey, Index, func
from sqlalchemy.orm import relationship
from sqlalchemy.types import BigInteger, DateTime, Integer, String
from pollbot.db import base
from pollbot.enums import ReferenceType
class ... | 27.99187 | 97 | 0.637816 | from __future__ import annotations
from sqlalchemy import Column, ForeignKey, Index, func
from sqlalchemy.orm import relationship
from sqlalchemy.types import BigInteger, DateTime, Integer, String
from pollbot.db import base
from pollbot.enums import ReferenceType
class Reference(base):
__tablename__ = "refere... | true | true |
f71fec1a43d05877719e3969203eaab05fae4883 | 10,145 | py | Python | metadl/core/scoring/scoring.py | mikehuisman/metadl | 61ece0364b08e67412ab87da4a41425b2e88a562 | [
"Apache-2.0"
] | 26 | 2020-09-23T13:04:52.000Z | 2022-03-03T03:07:49.000Z | metadl/core/scoring/scoring.py | mikehuisman/metadl | 61ece0364b08e67412ab87da4a41425b2e88a562 | [
"Apache-2.0"
] | 5 | 2020-11-04T13:26:09.000Z | 2021-09-17T07:42:01.000Z | metadl/core/scoring/scoring.py | mikehuisman/metadl | 61ece0364b08e67412ab87da4a41425b2e88a562 | [
"Apache-2.0"
] | 12 | 2020-11-03T12:01:35.000Z | 2021-12-19T03:58:50.000Z | """ Runs the scoring procedure for the challenge.
It assumes that there exists a ./model_dir folder containing both the
submission code and the saved learner.
It will create a folder named ./scoring_output (default) in which a txt file
will contain the average score over 600 episodes. You can change the folder
name... | 38.869732 | 99 | 0.648398 | import os
from sys import path
import scipy.stats
import gin
import numpy as np
from absl import app
from absl import flags
from absl import logging
import tensorflow as tf
from metadl.data.dataset import DataGenerator
from metadl.core.ingestion.ingestion import get_gin_path, show_dir
FLAGS = flags.FLAGS
flags.D... | true | true |
f71fed6c463f4fb9305f4215a3d3f237674e9c98 | 6,399 | py | Python | Graph-based/processor/recognition.py | EnTimeMent/Group-Behavior-Recognition | d6606e9e7bef836a9ccc5b4ada66933a4770171c | [
"MIT"
] | 3 | 2020-12-29T04:07:58.000Z | 2022-01-11T14:47:16.000Z | Graph-based/processor/recognition.py | EnTimeMent/Group-Behavior-Recognition | d6606e9e7bef836a9ccc5b4ada66933a4770171c | [
"MIT"
] | 1 | 2021-01-02T10:28:07.000Z | 2021-01-04T18:01:42.000Z | Graph-based/processor/recognition.py | EnTimeMent/Group-Behavior-Recognition | d6606e9e7bef836a9ccc5b4ada66933a4770171c | [
"MIT"
] | 1 | 2022-01-09T12:55:41.000Z | 2022-01-09T12:55:41.000Z | #!/usr/bin/env python
# pylint: disable=W0201
import sys
import argparse
import yaml
import numpy as np
# torch
import torch
import torch.nn as nn
import torch.optim as optim
# torchlight
import torchlight
from torchlight import str2bool
from torchlight import DictAction
from torchlight import import_class
from .pro... | 32.482234 | 94 | 0.556493 |
import sys
import argparse
import yaml
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torchlight
from torchlight import str2bool
from torchlight import DictAction
from torchlight import import_class
from .processor import Processor
from sklearn.metrics import confusion_m... | true | true |
f71fedf23526603a8b5b482439d51773bdec5bd3 | 3,347 | py | Python | medseer/migrations/0001_initial.py | noureldin-eg/medseer | 8a68cd92a757ab3141081547d322c0c6b2056d66 | [
"Apache-2.0"
] | null | null | null | medseer/migrations/0001_initial.py | noureldin-eg/medseer | 8a68cd92a757ab3141081547d322c0c6b2056d66 | [
"Apache-2.0"
] | null | null | null | medseer/migrations/0001_initial.py | noureldin-eg/medseer | 8a68cd92a757ab3141081547d322c0c6b2056d66 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.10 on 2022-01-25 22:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
... | 46.486111 | 125 | 0.582611 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
('id', models.BigAutoField(auto_created... | true | true |
f71fee147634858badedf4ea69e3f4bc26bb7e78 | 2,052 | py | Python | tests/parsers/plist_plugins/ipod.py | jeppetrost/plaso | b48008c6ea79950eeeef3a05b3a859086c8704b6 | [
"Apache-2.0"
] | null | null | null | tests/parsers/plist_plugins/ipod.py | jeppetrost/plaso | b48008c6ea79950eeeef3a05b3a859086c8704b6 | [
"Apache-2.0"
] | null | null | null | tests/parsers/plist_plugins/ipod.py | jeppetrost/plaso | b48008c6ea79950eeeef3a05b3a859086c8704b6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the iPod plist plugin."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import ipod as _ # pylint: disable=unused-import
from plaso.lib import definitions
from plaso.parsers.plist_plugins import ipod
from tests import test_l... | 30.176471 | 80 | 0.729532 |
from __future__ import unicode_literals
import unittest
from plaso.formatters import ipod as _
from plaso.lib import definitions
from plaso.parsers.plist_plugins import ipod
from tests import test_lib as shared_test_lib
from tests.parsers.plist_plugins import test_lib
class TestIPodPlugin(test_lib.PlistPlugin... | true | true |
f71fee22e27eb7d42dc3efe0a61407b797d283a4 | 63,809 | py | Python | pandas/core/groupby/groupby.py | paritoshmittal09/pandas | 862d2d89b8fe0a93ec8e714315175e2eba1fa6e5 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/groupby.py | paritoshmittal09/pandas | 862d2d89b8fe0a93ec8e714315175e2eba1fa6e5 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/groupby.py | paritoshmittal09/pandas | 862d2d89b8fe0a93ec8e714315175e2eba1fa6e5 | [
"BSD-3-Clause"
] | null | null | null | """
Provide the groupby split-apply-combine paradigm. Define the GroupBy
class providing the base-class of operations.
The SeriesGroupBy and DataFrameGroupBy sub-class
(defined in pandas.core.groupby.generic)
expose these user-facing objects to provide specific functionailty.
"""
import types
from functools import wr... | 32.439756 | 82 | 0.555862 |
import types
from functools import wraps, partial
import datetime
import collections
import warnings
from contextlib import contextmanager
import numpy as np
from pandas._libs import groupby as libgroupby, Timestamp
from pandas.util._validators import validate_kwargs
from pandas.util._decorators import (
cache_r... | true | true |
f71fef0c42afe5737fff68a898b0a1503169b16b | 303 | py | Python | mundo 3/des085.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | mundo 3/des085.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | mundo 3/des085.py | Pedroluis1/python | d949fa2646c049aa51a41a32dc62de7b14eae90f | [
"MIT"
] | null | null | null | valores = [[], []]
val = 0
for c in range(1, 8):
val = int(input(f'Digite o {c}° valor: '))
if val % 2 == 0:
valores[0].append(val)
else:
valores[1].append(val)
valores[0].sort()
valores[1].sort()
print(f'valores impares: {valores[1]}')
print(f'valores pares: {valores[0]}')
| 23.307692 | 46 | 0.567657 | valores = [[], []]
val = 0
for c in range(1, 8):
val = int(input(f'Digite o {c}° valor: '))
if val % 2 == 0:
valores[0].append(val)
else:
valores[1].append(val)
valores[0].sort()
valores[1].sort()
print(f'valores impares: {valores[1]}')
print(f'valores pares: {valores[0]}')
| true | true |
f71fefeee470de4abd81815f4b20fd0e5aa1ae84 | 6,228 | py | Python | pypy/translator/platform/posix.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/translator/platform/posix.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/translator/platform/posix.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null |
""" Base class for all posixish platforms
"""
from pypy.translator.platform import Platform, log, _run_subprocess
from pypy.tool import autopath
import py, os
class BasePosix(Platform):
exe_ext = ''
def __init__(self, cc=None):
if cc is None:
cc = 'gcc'
self.cc = cc
def _lib... | 30.985075 | 96 | 0.538536 |
from pypy.translator.platform import Platform, log, _run_subprocess
from pypy.tool import autopath
import py, os
class BasePosix(Platform):
exe_ext = ''
def __init__(self, cc=None):
if cc is None:
cc = 'gcc'
self.cc = cc
def _libs(self, libraries):
return ['-l%s' % (... | true | true |
f71ff11e0a47dc49e9286ac8954a588df8c45b2e | 64 | py | Python | test/core/metaflow_custom/toplevel/__init__.py | saikonen/metaflow | 48e37bea3ea4e83ddab8227869bbe56b52d9957d | [
"Apache-2.0"
] | 7 | 2020-07-24T17:07:58.000Z | 2021-05-19T21:47:12.000Z | test/core/metaflow_custom/toplevel/__init__.py | saikonen/metaflow | 48e37bea3ea4e83ddab8227869bbe56b52d9957d | [
"Apache-2.0"
] | 55 | 2020-07-20T16:56:27.000Z | 2022-03-28T12:51:15.000Z | test/core/metaflow_custom/toplevel/__init__.py | saikonen/metaflow | 48e37bea3ea4e83ddab8227869bbe56b52d9957d | [
"Apache-2.0"
] | 6 | 2020-10-15T18:38:35.000Z | 2021-06-20T03:05:43.000Z | __mf_customization__ = 'test'
tl_value = 42
__version__ = None | 12.8 | 29 | 0.765625 | __mf_customization__ = 'test'
tl_value = 42
__version__ = None | true | true |
f71ff1359f7c6ddeef12a05d12e6963d96fa007e | 2,569 | py | Python | jspp_imageutils/annotations/convert.py | jspaezp/jspp_imageutils | 6376e274a1b0675622a7979c181b9effc125aa09 | [
"Apache-2.0"
] | null | null | null | jspp_imageutils/annotations/convert.py | jspaezp/jspp_imageutils | 6376e274a1b0675622a7979c181b9effc125aa09 | [
"Apache-2.0"
] | null | null | null | jspp_imageutils/annotations/convert.py | jspaezp/jspp_imageutils | 6376e274a1b0675622a7979c181b9effc125aa09 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# modified from:
# https://gist.github.com/rotemtam/88d9a4efae243fc77ed4a0f9917c8f6c
import os
import glob
import click
import pandas as pd
import xml.etree.ElementTree as ET
def xml_to_csv(path: str) -> pd.DataFrame:
xml_list = []
for xml_file in glob.glob(pat... | 29.528736 | 79 | 0.570261 |
import os
import glob
import click
import pandas as pd
import xml.etree.ElementTree as ET
def xml_to_csv(path: str) -> pd.DataFrame:
xml_list = []
for xml_file in glob.glob(path):
tree = ET.parse(xml_file)
root = tree.getroot()
for member in root.findall('object'):
b... | true | true |
f71ff15ecd2f2844f2c2b918043ff8217bac2c9b | 3,796 | py | Python | Week6/AdvML_Week6_ex2.py | mikkokotola/AdvancedMachineLearning | 574e82d4104ac04f1cb9889beb5be7d122bd0d01 | [
"MIT"
] | 1 | 2020-03-18T08:51:44.000Z | 2020-03-18T08:51:44.000Z | Week6/AdvML_Week6_ex2.py | mikkokotola/AdvancedMachineLearning | 574e82d4104ac04f1cb9889beb5be7d122bd0d01 | [
"MIT"
] | null | null | null | Week6/AdvML_Week6_ex2.py | mikkokotola/AdvancedMachineLearning | 574e82d4104ac04f1cb9889beb5be7d122bd0d01 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[8]:
## Advanced Course in Machine Learning
## Week 6
## Exercise 2 / Random forest
import numpy as np
import scipy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from numpy import linalg as LA
from sklearn... | 19.171717 | 84 | 0.663593 |
sns
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from numpy import linalg as LA
from sklearn import decomposition
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import pairwise_distances
from sklearn.manifold import TSNE
import math
import sys
import mnist
from... | true | true |
f71ff26a2521e900d339ce88a0f2dc11b89982ac | 8,979 | py | Python | models/layers/mesh_pool.py | yamaguchi1024/MeshCNN | 197530eab2aa4c2419511c1854dcbc662377f340 | [
"MIT"
] | null | null | null | models/layers/mesh_pool.py | yamaguchi1024/MeshCNN | 197530eab2aa4c2419511c1854dcbc662377f340 | [
"MIT"
] | null | null | null | models/layers/mesh_pool.py | yamaguchi1024/MeshCNN | 197530eab2aa4c2419511c1854dcbc662377f340 | [
"MIT"
] | 1 | 2020-10-10T23:31:50.000Z | 2020-10-10T23:31:50.000Z | import torch
import torch.nn as nn
from threading import Thread
from models.layers.mesh_union import MeshUnion
import numpy as np
from heapq import heappop, heapify
class MeshPool(nn.Module):
def __init__(self, target, multi_thread=False):
super(MeshPool, self).__init__()
self.__out_target = ... | 44.014706 | 155 | 0.646397 | import torch
import torch.nn as nn
from threading import Thread
from models.layers.mesh_union import MeshUnion
import numpy as np
from heapq import heappop, heapify
class MeshPool(nn.Module):
def __init__(self, target, multi_thread=False):
super(MeshPool, self).__init__()
self.__out_target = ... | true | true |
f71ff2713f88d105f4975f0cee61ae6ef8e14fed | 896 | py | Python | nn_dataflow/nns/mlp_s.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | nn_dataflow/nns/mlp_s.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | nn_dataflow/nns/mlp_s.py | joeshow79/nn_dataflow | 279440452148ebf327992bd178a37cd5fd5330c5 | [
"BSD-3-Clause"
] | null | null | null | """ $lic$
Copyright (C) 2016-2019 by The Board of Trustees of Stanford University
This program is free software: you can redistribute it and/or modify it under
the terms of the Modified BSD-3 License as published by the Open Source
Initiative.
This program is distributed in the hope that it will be useful, but WITHOU... | 27.151515 | 79 | 0.756696 |
from nn_dataflow.core import Network
from nn_dataflow.core import InputLayer, FCLayer
NN = Network('MLP-S')
NN.set_input_layer(InputLayer(784, 1))
NN.add('fc1', FCLayer(784, 500))
NN.add('fc2', FCLayer(500, 250))
NN.add('fc3', FCLayer(250, 10))
| true | true |
f71ff2d8ade82949986924ccc275d50947e1700f | 3,753 | py | Python | nexuscasc/config/k8s_config_handler.py | vjda/nexus3-casc-cli | 6d33503c19f75b73b656293141911e083331faf0 | [
"MIT"
] | 7 | 2020-06-30T08:15:53.000Z | 2022-03-22T10:28:09.000Z | nexuscasc/config/k8s_config_handler.py | vjda/nexus3-casc-cli | 6d33503c19f75b73b656293141911e083331faf0 | [
"MIT"
] | 1 | 2021-09-27T03:24:46.000Z | 2021-09-27T03:24:46.000Z | nexuscasc/config/k8s_config_handler.py | vjda/nexus3-casc-cli | 6d33503c19f75b73b656293141911e083331faf0 | [
"MIT"
] | 1 | 2020-12-07T14:55:30.000Z | 2020-12-07T14:55:30.000Z | import base64
import re
from dataclasses import dataclass
from enum import Enum
from typing import Union, List
from kubernetes import client, config
from kubernetes.client import V1ConfigMapList, V1SecretList, CoreV1Api, V1Secret, V1ConfigMap
from nexuscasc.logger import Logger
class ResourceType(Enum):
SECRET,... | 38.295918 | 119 | 0.625633 | import base64
import re
from dataclasses import dataclass
from enum import Enum
from typing import Union, List
from kubernetes import client, config
from kubernetes.client import V1ConfigMapList, V1SecretList, CoreV1Api, V1Secret, V1ConfigMap
from nexuscasc.logger import Logger
class ResourceType(Enum):
SECRET,... | true | true |
f71ff2dfd267b7ca272fcc6a2a50017e19cd8ff1 | 3,423 | py | Python | tests/commands/spot/test_limit_order_cmd.py | mpetrinidev/bnb-cli | d10fc36b6a1e2dd34597d9f31ea143019ba6f4b9 | [
"MIT"
] | 5 | 2021-04-02T20:49:19.000Z | 2021-06-11T06:22:24.000Z | tests/commands/spot/test_limit_order_cmd.py | mpetrinidev/bnb-cli | d10fc36b6a1e2dd34597d9f31ea143019ba6f4b9 | [
"MIT"
] | 2 | 2021-06-13T20:22:09.000Z | 2021-06-14T23:09:14.000Z | tests/commands/spot/test_limit_order_cmd.py | mpetrinidev/bnc-cli | d10fc36b6a1e2dd34597d9f31ea143019ba6f4b9 | [
"MIT"
] | null | null | null | import datetime
import os
from unittest.mock import Mock
from bnc.cli import cli
from bnc.utils.utils import json_to_str
from tests.commands.common import read_json_test_file, get_headers
from tests.commands.common_fixtures import *
def get_json_filename():
return os.path.join(os.path.dirname(os.path.abspath(__f... | 48.211268 | 138 | 0.650891 | import datetime
import os
from unittest.mock import Mock
from bnc.cli import cli
from bnc.utils.utils import json_to_str
from tests.commands.common import read_json_test_file, get_headers
from tests.commands.common_fixtures import *
def get_json_filename():
return os.path.join(os.path.dirname(os.path.abspath(__f... | true | true |
f71ff3f9334377468b2b24b73aa343bc3c717efb | 2,218 | py | Python | src/odontology/core/migrations/0009_chapter_tariff.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | 2 | 2016-06-23T15:35:29.000Z | 2022-01-11T00:55:21.000Z | src/odontology/core/migrations/0009_chapter_tariff.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | 27 | 2016-06-24T12:28:01.000Z | 2022-01-13T00:37:25.000Z | src/odontology/core/migrations/0009_chapter_tariff.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-09-02 20:22
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20160801_1937'),
]
operations = [... | 50.409091 | 131 | 0.625338 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20160801_1937'),
]
operations = [
migrations.CreateModel(
name='Chapter',
... | true | true |
f71ff457dfbaab5f3f5847da75668942d7052f7a | 3,330 | py | Python | dockerdjango/dockerdjango/settings.py | ducanhvna/DockerDjango | ab5dcb801691fa1ef15a38f05e75fe58066c61ae | [
"MIT"
] | null | null | null | dockerdjango/dockerdjango/settings.py | ducanhvna/DockerDjango | ab5dcb801691fa1ef15a38f05e75fe58066c61ae | [
"MIT"
] | 9 | 2019-12-04T23:29:22.000Z | 2022-02-10T12:19:23.000Z | dockerdjango/dockerdjango/settings.py | ducanhvna/DockerDjango | ab5dcb801691fa1ef15a38f05e75fe58066c61ae | [
"MIT"
] | null | null | null | """
Django settings for dockerdjango project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import ... | 25.419847 | 91 | 0.678378 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'gc(_1u30_&as3g*xqy8k@u$aj22*@_#d$ylw@s8cjfjmz%ukq('
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f71ff4f192b3057091ebc889bf78714a2e21a9d6 | 2,455 | py | Python | examples/pybullet/examples/quadruped_setup_playback.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 9,136 | 2015-01-02T00:41:45.000Z | 2022-03-31T15:30:02.000Z | examples/pybullet/examples/quadruped_setup_playback.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,424 | 2015-01-05T08:55:58.000Z | 2022-03-30T19:34:55.000Z | examples/pybullet/examples/quadruped_setup_playback.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,921 | 2015-01-02T10:19:30.000Z | 2022-03-31T02:48:42.000Z | import pybullet as p
import pybullet_data
p.connect(p.SHARED_MEMORY)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
objects = [
p.loadURDF("plane.urdf", 0.000000, 0.000000, -.300000, 0.000000, 0.000000, 0.000000, 1.000000)
]
objects = [
p.loadURDF("quadruped/minitaur.urdf", [-0.000046, -0.000068, 0.20... | 51.145833 | 98 | 0.608147 | import pybullet as p
import pybullet_data
p.connect(p.SHARED_MEMORY)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
objects = [
p.loadURDF("plane.urdf", 0.000000, 0.000000, -.300000, 0.000000, 0.000000, 0.000000, 1.000000)
]
objects = [
p.loadURDF("quadruped/minitaur.urdf", [-0.000046, -0.000068, 0.20... | true | true |
f71ff582921b55fc70764b796e2441625d14a39b | 3,212 | py | Python | quati/dataset/corpora/imdb.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | 2 | 2021-01-30T21:20:36.000Z | 2021-01-30T22:15:07.000Z | quati/dataset/corpora/imdb.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | null | null | null | quati/dataset/corpora/imdb.py | onenoc/quati | ba372b2ad14076294af62cbcbc27e1b3ca8421c1 | [
"MIT"
] | 1 | 2021-01-18T23:12:18.000Z | 2021-01-18T23:12:18.000Z | from itertools import chain
from pathlib import Path
import nltk
import torchtext
from quati.dataset.fields.words import WordsField
from quati.dataset.fields.tags import TagsField
from quati.dataset.corpora.corpus import Corpus
def create_single_file_for_pos_and_neg(corpus_path):
new_file_path = Path(corpus_pat... | 33.113402 | 76 | 0.59589 | from itertools import chain
from pathlib import Path
import nltk
import torchtext
from quati.dataset.fields.words import WordsField
from quati.dataset.fields.tags import TagsField
from quati.dataset.corpora.corpus import Corpus
def create_single_file_for_pos_and_neg(corpus_path):
new_file_path = Path(corpus_pat... | true | true |
f71ff58b38aa884ffd4cc5997958ad2274a7a77b | 491 | py | Python | tests/system/test_base.py | aalmazanarbs/memstatsbeat | 554be8f67c385f4e9aeccfdc09b838075c8e1714 | [
"Apache-2.0"
] | null | null | null | tests/system/test_base.py | aalmazanarbs/memstatsbeat | 554be8f67c385f4e9aeccfdc09b838075c8e1714 | [
"Apache-2.0"
] | null | null | null | tests/system/test_base.py | aalmazanarbs/memstatsbeat | 554be8f67c385f4e9aeccfdc09b838075c8e1714 | [
"Apache-2.0"
] | null | null | null | from memstatsbeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
"""
Basic test with exiting Memstatsbeat normally
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
memstatsbeat_proc = self.star... | 24.55 | 77 | 0.641548 | from memstatsbeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
memstatsbeat_proc = self.start_beat()
self.wait_until(lambda: self.log_contains("memstatsbeat is ru... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.