hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c225c324d1e4d2f541357ab8fadc5e1cc5f9955 | 2,330 | py | Python | azure-mgmt-media/azure/mgmt/media/models/video.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-media/azure/mgmt/media/models/video.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-media/azure/mgmt/media/models/video.py | NMijat1024/azure-sdk-for-python | c49e1d6d797dceaca81813cafb1a486d67185182 | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 39.491525 | 99 | 0.634764 |
from .codec import Codec
class Video(Codec):
_validation = {
'odatatype': {'required': True},
}
_attribute_map = {
'label': {'key': 'label', 'type': 'str'},
'odatatype': {'key': '@odata\\.type', 'type': 'str'},
'key_frame_interval': {'key': 'keyFrameInterval', ... | true | true |
1c225c4e18e0af38e84b4043c9759c4764597c88 | 2,841 | py | Python | CodeAnalysis/SourceMeter_Interface/SourceMeter-8.2.0-x64-linux/Python/Demo/ceilometer/ceilometer/storage/sqlalchemy/migrate_repo/versions/024_event_use_floatingprecision.py | ishtjot/susereumutep | 56e20c1777e0c938ac42bd8056f84af9e0b76e46 | [
"Apache-2.0"
] | 2 | 2018-11-07T20:52:53.000Z | 2019-10-20T15:57:01.000Z | CodeAnalysis/SourceMeter_Interface/SourceMeter-8.2.0-x64-linux/Python/Demo/ceilometer/ceilometer/storage/sqlalchemy/migrate_repo/versions/024_event_use_floatingprecision.py | ishtjot/susereumutep | 56e20c1777e0c938ac42bd8056f84af9e0b76e46 | [
"Apache-2.0"
] | 3 | 2021-12-14T20:57:54.000Z | 2022-01-21T23:50:36.000Z | CodeAnalysis/SourceMeter_Interface/SourceMeter-8.2.0-x64-linux/Python/Demo/ceilometer/ceilometer/storage/sqlalchemy/migrate_repo/versions/024_event_use_floatingprecision.py | ishtjot/susereumutep | 56e20c1777e0c938ac42bd8056f84af9e0b76e46 | [
"Apache-2.0"
] | 2 | 2018-11-16T04:20:06.000Z | 2019-03-28T23:49:13.000Z | #
# Copyright 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
#
# 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.... | 40.585714 | 79 | 0.645547 |
import sqlalchemy as sa
from ceilometer.storage.sqlalchemy import migration
from ceilometer.storage.sqlalchemy import models
def _convert_data_type(table, col, from_t, to_t, pk_attr='id', index=False):
temp_col_n = 'convert_data_type_temp_col'
table = sa.Table(table.n... | true | true |
1c225c6d709e160881c1e2a4aae1fa48287c1557 | 1,568 | py | Python | plotly/validators/parcoords/_hoverlabel.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2018-07-16T01:51:47.000Z | 2018-07-16T01:51:47.000Z | plotly/validators/parcoords/_hoverlabel.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/parcoords/_hoverlabel.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2019-02-18T04:12:56.000Z | 2019-02-18T04:12:56.000Z | import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='hoverlabel', parent_name='parcoords', **kwargs
):
super(HoverlabelValidator, self).__init__(
plotly_name=plotly_name,
parent_... | 37.333333 | 74 | 0.555485 | import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='hoverlabel', parent_name='parcoords', **kwargs
):
super(HoverlabelValidator, self).__init__(
plotly_name=plotly_name,
parent_... | true | true |
1c22602042617b681925cb513aadfc961914cffc | 3,122 | py | Python | tools/alpha.py | Dev00355/fundamental-tools-copy-from-sap | 1857db103789dde84e9eb40105ecaf029a4cf360 | [
"Apache-2.0"
] | null | null | null | tools/alpha.py | Dev00355/fundamental-tools-copy-from-sap | 1857db103789dde84e9eb40105ecaf029a4cf360 | [
"Apache-2.0"
] | null | null | null | tools/alpha.py | Dev00355/fundamental-tools-copy-from-sap | 1857db103789dde84e9eb40105ecaf029a4cf360 | [
"Apache-2.0"
] | null | null | null | #!/home/pos/.virtualenvs/picoUI/bin/python
# SPDX-FileCopyrightText: 2014 SAP SE Srdjan Boskovic <srdjan.boskovic@sap.com>
#
# SPDX-License-Identifier: Apache-2.0
# -*- coding: utf-8 -*-
""" Parse 1 RFM metadata into UI7 elements
:param rfm name, Params, Fields
:return: RFM Parameters/Field View and Param... | 30.31068 | 96 | 0.597373 |
import os
import json
import codecs
import re
import shutil
import sys
from collections import OrderedDict
from datetime import datetime
from generator import VERSION, catalog, rfm_sets
from backend import INPUT_TYPE_KEY, INPUT_TYPE_BINARY, INPUT_TYPE_LIST
class AlphaParser:
def __init__(self, rfmset):
... | true | true |
1c226187ad8bb30b6f1f71fa843aa9ee7c3a3d32 | 125 | py | Python | main.py | Tuss4/django-el-wrapper | 917c66cc5c86a71630ed5f4f248b1ba6d2053bcf | [
"MIT"
] | null | null | null | main.py | Tuss4/django-el-wrapper | 917c66cc5c86a71630ed5f4f248b1ba6d2053bcf | [
"MIT"
] | null | null | null | main.py | Tuss4/django-el-wrapper | 917c66cc5c86a71630ed5f4f248b1ba6d2053bcf | [
"MIT"
] | null | null | null | import time
def main():
while True:
print("Bro")
time.sleep(2)
if __name__ == "__main__":
main()
| 10.416667 | 26 | 0.528 | import time
def main():
while True:
print("Bro")
time.sleep(2)
if __name__ == "__main__":
main()
| true | true |
1c2261aa496bf8c289a1cf89b51cb1e2016e32fb | 661 | py | Python | cockroach-gssapi-django/manage.py | dbist/cockroach-docker | d628b1d9d2a63d868ae17be39a7136e2e28e5598 | [
"Apache-2.0"
] | 2 | 2021-12-10T00:57:39.000Z | 2022-02-28T04:36:38.000Z | cockroach-gssapi-django/manage.py | dbist/cockroach-docker | d628b1d9d2a63d868ae17be39a7136e2e28e5598 | [
"Apache-2.0"
] | 69 | 2020-07-20T16:00:19.000Z | 2022-01-31T19:30:16.000Z | cockroach-gssapi-django/manage.py | dbist/cockroach-docker | d628b1d9d2a63d868ae17be39a7136e2e28e5598 | [
"Apache-2.0"
] | 3 | 2020-11-05T18:36:55.000Z | 2021-12-05T06:55:46.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
# pylint: disable=C0116,C0415
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
try:
from django.core.management import execute_from_command_line
except Import... | 26.44 | 73 | 0.685325 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c226332327690f9d24b60f592f63d9ba896eb39 | 1,895 | py | Python | tests/utils.py | nzarin/rollercoaster-tudelft | 1a1f4bfe3c6bbd107b04d37cfd83a9adf2a39037 | [
"MIT"
] | 2 | 2021-11-21T17:27:52.000Z | 2022-01-31T10:14:02.000Z | tests/utils.py | lambdapioneer/rollercoaster | 5341cea20b8bc028aaa308d6cea5bf0f349d8eb4 | [
"MIT"
] | null | null | null | tests/utils.py | lambdapioneer/rollercoaster | 5341cea20b8bc028aaa308d6cea5bf0f349d8eb4 | [
"MIT"
] | null | null | null | from simulation.loopix import *
from simulation.messages import *
from simulation.simrandom import *
from simulation.simulation import *
class DummySimulationObject(SimulationObject):
def __init__(self, name):
super().__init__(name)
self.inbox = []
def deliver(self, sim, m):
self.inb... | 24.934211 | 78 | 0.648021 | from simulation.loopix import *
from simulation.messages import *
from simulation.simrandom import *
from simulation.simulation import *
class DummySimulationObject(SimulationObject):
def __init__(self, name):
super().__init__(name)
self.inbox = []
def deliver(self, sim, m):
self.inb... | true | true |
1c2264e4d62563ecbc14eba2822455d3f98c7681 | 9,493 | py | Python | eb-virt/lib/python2.7/site-packages/googlemaps/convert.py | jgao18/gimme-shelter | 72a26efc669db281d0da190dc8a1a07e86c76e0d | [
"MIT"
] | null | null | null | eb-virt/lib/python2.7/site-packages/googlemaps/convert.py | jgao18/gimme-shelter | 72a26efc669db281d0da190dc8a1a07e86c76e0d | [
"MIT"
] | null | null | null | eb-virt/lib/python2.7/site-packages/googlemaps/convert.py | jgao18/gimme-shelter | 72a26efc669db281d0da190dc8a1a07e86c76e0d | [
"MIT"
] | null | null | null | #
# Copyright 2014 Google Inc. 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 ... | 25.866485 | 80 | 0.604235 |
import time as _time
def format_float(arg):
return ("%f" % float(arg)).rstrip("0").rstrip(".")
def latlng(arg):
if is_string(arg):
return arg
normalized = normalize_lat_lng(arg)
return "%s,%s" % (format_float(normalized[0]), format_float(normalized[1]))
def normalize_lat... | true | true |
1c22659ee27cd008ad9e9de028b28a2a6c397826 | 13,010 | py | Python | tech_project/lib/python2.7/site-packages/filer/tests/models.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | null | null | null | tech_project/lib/python2.7/site-packages/filer/tests/models.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | null | null | null | tech_project/lib/python2.7/site-packages/filer/tests/models.py | priyamshah112/Project-Descripton-Blog | 8e01016c6be79776c4f5ca75563fa3daa839e39e | [
"MIT"
] | 4 | 2018-08-07T17:13:48.000Z | 2019-06-13T11:09:32.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
from django.conf import settings
from django.core.files import File as DjangoFile
from django.forms.models import modelform_factory
from django.test import TestCase
from .. import settings as filer_settings
from ..models.clipb... | 40.154321 | 105 | 0.65565 |
from __future__ import absolute_import, unicode_literals
import os
from django.conf import settings
from django.core.files import File as DjangoFile
from django.forms.models import modelform_factory
from django.test import TestCase
from .. import settings as filer_settings
from ..models.clipboardmodels import Clipb... | true | true |
1c22668b720d459da6a72ddb496a802f6f0d54dd | 21,291 | py | Python | layoutreader/run_seq2seq.py | Maria-philna/unilm | 5550a335c6d2ae5838b1a90e50cb46f81edcd50f | [
"MIT"
] | 5,129 | 2019-09-30T11:21:03.000Z | 2022-03-31T22:35:12.000Z | layoutreader/run_seq2seq.py | Maria-philna/unilm | 5550a335c6d2ae5838b1a90e50cb46f81edcd50f | [
"MIT"
] | 604 | 2019-10-05T00:39:46.000Z | 2022-03-31T11:12:07.000Z | layoutreader/run_seq2seq.py | Maria-philna/unilm | 5550a335c6d2ae5838b1a90e50cb46f81edcd50f | [
"MIT"
] | 1,034 | 2019-09-30T15:01:32.000Z | 2022-03-31T06:14:50.000Z | from __future__ import absolute_import, division, print_function
import argparse
import json
import logging
import os
import random
import numpy as np
import torch
from torch.utils.data import (DataLoader, SequentialSampler)
from torch.utils.data.distributed import DistributedSampler
try:
from torch.utils.tensor... | 47.524554 | 126 | 0.664835 | from __future__ import absolute_import, division, print_function
import argparse
import json
import logging
import os
import random
import numpy as np
import torch
from torch.utils.data import (DataLoader, SequentialSampler)
from torch.utils.data.distributed import DistributedSampler
try:
from torch.utils.tensor... | true | true |
1c2266ea0942d0c5f77ff1d5ba694f7bf2945ebf | 1,002 | py | Python | examples/rf_multipole/rf_multipole.py | pkicsiny/xline | a0dcc6655082bc08e882509bc4e65204de836b8a | [
"Apache-2.0"
] | 1 | 2021-09-07T14:33:26.000Z | 2021-09-07T14:33:26.000Z | examples/rf_multipole/rf_multipole.py | pkicsiny/xline | a0dcc6655082bc08e882509bc4e65204de836b8a | [
"Apache-2.0"
] | 1 | 2021-12-15T10:27:13.000Z | 2021-12-15T10:27:13.000Z | examples/rf_multipole/rf_multipole.py | pkicsiny/xline | a0dcc6655082bc08e882509bc4e65204de836b8a | [
"Apache-2.0"
] | 4 | 2021-07-08T10:32:15.000Z | 2021-09-02T11:16:34.000Z | import numpy as np
from cpymad.madx import Madx
import xline
# run MADX tests
mad = Madx()
mad.call("rf_multipole.madx")
# create xline rfmultipole
mad_sequence = mad.sequence["sequ_rfmultipole"]
rf_mulitpole_mad = mad_sequence.elements[1]
freq = rf_mulitpole_mad.freq * 1e6 # MAD units are MHz
knl = rf_mulitpole_ma... | 24.439024 | 71 | 0.742515 | import numpy as np
from cpymad.madx import Madx
import xline
mad = Madx()
mad.call("rf_multipole.madx")
mad_sequence = mad.sequence["sequ_rfmultipole"]
rf_mulitpole_mad = mad_sequence.elements[1]
freq = rf_mulitpole_mad.freq * 1e6
knl = rf_mulitpole_mad.knl
pn = np.array(rf_mulitpole_mad.pnl) * 360
lag = rf_mu... | true | true |
1c22677c50792430b3c195cd863af7672f230a43 | 21,849 | py | Python | snip/network.py | Danderson123/snip-public | e464ffed8b76a102ae485ab12b44f0f3b5314ce4 | [
"MIT"
] | 85 | 2019-03-15T03:52:56.000Z | 2022-03-14T10:30:27.000Z | snip/network.py | Danderson123/snip-public | e464ffed8b76a102ae485ab12b44f0f3b5314ce4 | [
"MIT"
] | 1 | 2019-04-23T07:35:15.000Z | 2019-04-23T07:35:15.000Z | snip/network.py | Danderson123/snip-public | e464ffed8b76a102ae485ab12b44f0f3b5314ce4 | [
"MIT"
] | 18 | 2019-08-21T06:45:06.000Z | 2022-01-10T13:02:42.000Z | import tensorflow as tf
from functools import reduce
from helpers import static_size
def load_network(
datasource, arch, num_classes,
initializer_w_bp, initializer_b_bp, initializer_w_ap, initializer_b_ap,
):
networks = {
'lenet300': lambda: LeNet300(
initializer_w_bp,... | 50.343318 | 100 | 0.567806 | import tensorflow as tf
from functools import reduce
from helpers import static_size
def load_network(
datasource, arch, num_classes,
initializer_w_bp, initializer_b_bp, initializer_w_ap, initializer_b_ap,
):
networks = {
'lenet300': lambda: LeNet300(
initializer_w_bp,... | true | true |
1c2268c25ef5bcc631c7fe1e1d600eac38005b78 | 1,855 | py | Python | stsciutils/stimage/test/test_geomap.py | spacetelescope/stsciutils | 85df1f215071a9c00a1e8cf3da823b5fedf8f2f2 | [
"BSD-3-Clause"
] | null | null | null | stsciutils/stimage/test/test_geomap.py | spacetelescope/stsciutils | 85df1f215071a9c00a1e8cf3da823b5fedf8f2f2 | [
"BSD-3-Clause"
] | 1 | 2019-06-05T18:56:33.000Z | 2020-11-19T16:33:50.000Z | stsciutils/stimage/test/test_geomap.py | spacetelescope/stsciutils | 85df1f215071a9c00a1e8cf3da823b5fedf8f2f2 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2008-2010 Association of Universities for Research in Astronomy (AURA)
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# noti... | 39.468085 | 86 | 0.735849 |
import numpy as np
import stsciutils.stimage as stimage
if __name__ == '__main__':
test_same()
| true | true |
1c2269a0aa3011721e3441267bd035c050173276 | 42 | py | Python | simulator/utils/__init__.py | adimaini/comp_arch_computer | 2de48f0fc7657f43753ded364712b464ab7db783 | [
"MIT"
] | null | null | null | simulator/utils/__init__.py | adimaini/comp_arch_computer | 2de48f0fc7657f43753ded364712b464ab7db783 | [
"MIT"
] | null | null | null | simulator/utils/__init__.py | adimaini/comp_arch_computer | 2de48f0fc7657f43753ded364712b464ab7db783 | [
"MIT"
] | null | null | null | __all__ = ['binaryUtils', 'loggerConfig']
| 21 | 41 | 0.714286 | __all__ = ['binaryUtils', 'loggerConfig']
| true | true |
1c2269c3b40b322aace62c0416f3d24c76bf0f43 | 614 | py | Python | contrib/qt_translations.py | payeer1982/ArenonGameWallett | 7fb0028e8d74fae59aeb74c9cbe867a35ed73f6c | [
"MIT"
] | 2 | 2018-07-22T03:03:54.000Z | 2019-12-25T20:15:49.000Z | contrib/qt_translations.py | payeer1982/ArenonGameWallett | 7fb0028e8d74fae59aeb74c9cbe867a35ed73f6c | [
"MIT"
] | null | null | null | contrib/qt_translations.py | payeer1982/ArenonGameWallett | 7fb0028e8d74fae59aeb74c9cbe867a35ed73f6c | [
"MIT"
] | 1 | 2019-12-25T20:16:36.000Z | 2019-12-25T20:16:36.000Z | #!/usr/bin/env python
# Helpful little script that spits out a comma-separated list of
# language codes for Qt icons that should be included
# in binary transfer distributions
import glob
import os
import re
import sys
if len(sys.argv) != 3:
sys.exit("Usage: %s $QTDIR/translations $ArenonDIR/src/qt/locale"%sys.arg... | 26.695652 | 106 | 0.680782 |
import glob
import os
import re
import sys
if len(sys.argv) != 3:
sys.exit("Usage: %s $QTDIR/translations $ArenonDIR/src/qt/locale"%sys.argv[0])
d1 = sys.argv[1]
d2 = sys.argv[2]
l1 = set([ re.search(r'qt_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d1, 'qt_*.qm')) ])
l2 = set([ re.search(r'Arenon_(... | false | true |
1c226a2feeabe1be0898d3629a3fe9f4d0d65fbf | 25,190 | py | Python | skio/group.py | JGoutin/skio | 6c6e433232eca7371b0e9d94b8a75354dae7adab | [
"BSD-2-Clause"
] | null | null | null | skio/group.py | JGoutin/skio | 6c6e433232eca7371b0e9d94b8a75354dae7adab | [
"BSD-2-Clause"
] | null | null | null | skio/group.py | JGoutin/skio | 6c6e433232eca7371b0e9d94b8a75354dae7adab | [
"BSD-2-Clause"
] | null | null | null | """'Group' dict-like class definition"""
# TODO:
# - Find how show parameters and doc-strings for .set()/.get().
# - Orderable Group.
# - Autocomplete __doc__ with _doc, _dtype, ... information for subclasses.
# - Add unit information support with optional support of "pint" package.
# store data in group values witho... | 31.886076 | 79 | 0.559389 |
from collections import Mapping
from collections.abc import Iterable
from contextlib import contextmanager
from sys import getsizeof
from inspect import isclass
from copy import copy, deepcopy
from numpy import ndarray, array, ma
from itertools import chain
try:
import pint
UREG = pint.UnitRegis... | true | true |
1c226acd98c9df3905c6c5b27605f9c58be1ff5f | 1,020 | py | Python | 2017/python/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | 2017/python/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | 2017/python/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | def serialize(memory):
return ''.join([str(x) for x in memory])
def findLargestIndex(memory):
index = 0
for i in range(1, len(memory)):
if memory[i] > memory[index]:
index = i
return index
def redistribute(memory):
index = findLargestIndex(memory)
blocks = memory[index]
... | 24.878049 | 94 | 0.65098 | def serialize(memory):
return ''.join([str(x) for x in memory])
def findLargestIndex(memory):
index = 0
for i in range(1, len(memory)):
if memory[i] > memory[index]:
index = i
return index
def redistribute(memory):
index = findLargestIndex(memory)
blocks = memory[index]
... | true | true |
1c226ca9e7c0ea9ff58976999c20e707addd7ab8 | 5,875 | py | Python | aisoccer/tournament.py | eparkinson/ai-soccer | 399660a6fe611f59ba2552fc7a3728f6c5999c77 | [
"MIT"
] | 1 | 2020-12-16T10:16:09.000Z | 2020-12-16T10:16:09.000Z | aisoccer/tournament.py | eparkinson/ai-soccer | 399660a6fe611f59ba2552fc7a3728f6c5999c77 | [
"MIT"
] | 3 | 2020-12-16T10:22:39.000Z | 2021-01-08T12:34:31.000Z | aisoccer/tournament.py | eparkinson/ai-soccer | 399660a6fe611f59ba2552fc7a3728f6c5999c77 | [
"MIT"
] | null | null | null | from concurrent.futures.thread import ThreadPoolExecutor
from aisoccer.constants import Constants
from aisoccer.game import Game
class Tournament:
def __init__(self, brains, game_length=Constants.GAME_LENGTH, rounds=0):
self.rounds = rounds
self.brains = brains
self.game_length = game_len... | 33.959538 | 109 | 0.523404 | from concurrent.futures.thread import ThreadPoolExecutor
from aisoccer.constants import Constants
from aisoccer.game import Game
class Tournament:
def __init__(self, brains, game_length=Constants.GAME_LENGTH, rounds=0):
self.rounds = rounds
self.brains = brains
self.game_length = game_len... | true | true |
1c226cec4c2d6729458dc92ac3b72aaadf4f568c | 226 | py | Python | mmb_perceptron/mixed_impl/__init__.py | mbollmann/perceptron | 05e00af80491bed67859f09a71f15a3f0cf4b51b | [
"MIT"
] | null | null | null | mmb_perceptron/mixed_impl/__init__.py | mbollmann/perceptron | 05e00af80491bed67859f09a71f15a3f0cf4b51b | [
"MIT"
] | 6 | 2015-11-10T17:38:19.000Z | 2015-11-23T16:29:54.000Z | mmb_perceptron/mixed_impl/__init__.py | mbollmann/perceptron | 05e00af80491bed67859f09a71f15a3f0cf4b51b | [
"MIT"
] | null | null | null | from .combinatorial_perceptron import \
CombinatorialPerceptron_Mixed as CombinatorialPerceptron
from .combinatorial_viterbi_perceptron import \
CombinatorialViterbiPerceptron_Mixed as CombinatorialViterbiPerceptron
| 45.2 | 75 | 0.876106 | from .combinatorial_perceptron import \
CombinatorialPerceptron_Mixed as CombinatorialPerceptron
from .combinatorial_viterbi_perceptron import \
CombinatorialViterbiPerceptron_Mixed as CombinatorialViterbiPerceptron
| true | true |
1c226d7eecda0d55acc63bd92b5cb7c70c4cfae2 | 631 | py | Python | xsoccer/eventstatistics/migrations/0004_auto_20170112_2007.py | awyrough/xsoccer | 5f3d5f73ede21f6ba3baa0089a821b0a8d151b8d | [
"MIT"
] | null | null | null | xsoccer/eventstatistics/migrations/0004_auto_20170112_2007.py | awyrough/xsoccer | 5f3d5f73ede21f6ba3baa0089a821b0a8d151b8d | [
"MIT"
] | null | null | null | xsoccer/eventstatistics/migrations/0004_auto_20170112_2007.py | awyrough/xsoccer | 5f3d5f73ede21f6ba3baa0089a821b0a8d151b8d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-12 20:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('eventstatistics', '0003_auto_20170112_1927'),
]
operations = [
migrations.R... | 25.24 | 95 | 0.622821 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('eventstatistics', '0003_auto_20170112_1927'),
]
operations = [
migrations.RemoveField(
model_name='eventstatistic',
name='... | true | true |
1c226e9c08723781c26542517ee58abcd49b1f2d | 926 | py | Python | bbc1/libs/bbclib_config.py | imony/py-bbclib | c3644428e253ac60d4083696516d5a5deec3a633 | [
"Apache-2.0"
] | null | null | null | bbc1/libs/bbclib_config.py | imony/py-bbclib | c3644428e253ac60d4083696516d5a5deec3a633 | [
"Apache-2.0"
] | null | null | null | bbc1/libs/bbclib_config.py | imony/py-bbclib | c3644428e253ac60d4083696516d5a5deec3a633 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (c) 2018 beyond-blockchain.org.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | 31.931034 | 72 | 0.780778 |
import sys
import os
current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(current_dir, "../.."))
from bbc1.libs.bbclib_keypair import KeyType
from bbc1.libs.bbclib_wire import BBcFormat
DEFAULT_ID_LEN = 32
DEFAULT_CURVETYPE = KeyType.ECDSA_P256v1
DEFAULT_BBC_FORMAT = BBcFormat.FORMA... | true | true |
1c226ee8c29296e7a9ee247a50d2a725e31a7bfd | 2,233 | py | Python | homeassistant/components/device_automation/condition.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2021-11-22T22:37:43.000Z | 2022-03-17T00:55:28.000Z | homeassistant/components/device_automation/condition.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 25 | 2021-10-02T10:01:14.000Z | 2022-03-31T06:11:49.000Z | homeassistant/components/device_automation/condition.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """Validate device conditions."""
from __future__ import annotations
from typing import TYPE_CHECKING, Protocol, cast
import voluptuous as vol
from homeassistant.const import CONF_DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.... | 34.353846 | 87 | 0.76086 | from __future__ import annotations
from typing import TYPE_CHECKING, Protocol, cast
import voluptuous as vol
from homeassistant.const import CONF_DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType
from . i... | true | true |
1c226f2f8526a14cd9e159d1a9a11612e7160340 | 5,497 | py | Python | pytorch_lightning/examples/new_project_templates/multi_node_cluster_template.py | PeterouZh/pytorch-lightning | 6e32d00c8ca723c766ab6ff94adad1854bd89576 | [
"MIT"
] | null | null | null | pytorch_lightning/examples/new_project_templates/multi_node_cluster_template.py | PeterouZh/pytorch-lightning | 6e32d00c8ca723c766ab6ff94adad1854bd89576 | [
"MIT"
] | 1 | 2019-07-25T03:05:05.000Z | 2019-07-25T03:05:05.000Z | pytorch_lightning/examples/new_project_templates/multi_node_cluster_template.py | PeterouZh/pytorch-lightning | 6e32d00c8ca723c766ab6ff94adad1854bd89576 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
from time import sleep
import torch
from test_tube import HyperOptArgumentParser, Experiment, SlurmCluster
from pytorch_lightning.models.trainer import Trainer
from pytorch_lightning.utils.arg_parse import add_default_args
from pytorch_lightning.callbacks import EarlyStopping, ... | 31.774566 | 118 | 0.659814 | import os
import sys
import numpy as np
from time import sleep
import torch
from test_tube import HyperOptArgumentParser, Experiment, SlurmCluster
from pytorch_lightning.models.trainer import Trainer
from pytorch_lightning.utils.arg_parse import add_default_args
from pytorch_lightning.callbacks import EarlyStopping, ... | true | true |
1c22703de1e6e2628f737a88b61f366bf061d07f | 4,381 | py | Python | tests/test_fixedpolyvariablecomposite.py | hsadeghidw/dimod | c6b4adc18c22f39fd5a79e6775bbcab84b1a5489 | [
"Apache-2.0"
] | 101 | 2017-08-30T20:08:46.000Z | 2022-03-23T23:40:32.000Z | tests/test_fixedpolyvariablecomposite.py | hsadeghidw/dimod | c6b4adc18c22f39fd5a79e6775bbcab84b1a5489 | [
"Apache-2.0"
] | 862 | 2017-09-27T19:56:43.000Z | 2022-03-30T18:00:43.000Z | tests/test_fixedpolyvariablecomposite.py | hsadeghidw/dimod | c6b4adc18c22f39fd5a79e6775bbcab84b1a5489 | [
"Apache-2.0"
] | 78 | 2017-09-13T23:01:10.000Z | 2022-02-22T02:40:40.000Z | # 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... | 40.564815 | 101 | 0.636156 |
import unittest
import dimod.testing as dtest
from dimod.vartypes import Vartype
import dimod
from dimod import BinaryPolynomial
from dimod import PolyFixedVariableComposite, ExactPolySolver
from dimod import SampleSet
class TestFixedVariableComposite(unittest.TestCase):
def test_instantiation_s... | true | true |
1c22715ecf78e1e0f486a12c02a34d5d554e2432 | 1,529 | py | Python | gs/search/people/interfaces.py | groupserver/gs.search.people | 8b4914ac3b0cf1f467840de108ba03e3bc22c2fd | [
"ZPL-2.1"
] | null | null | null | gs/search/people/interfaces.py | groupserver/gs.search.people | 8b4914ac3b0cf1f467840de108ba03e3bc22c2fd | [
"ZPL-2.1"
] | null | null | null | gs/search/people/interfaces.py | groupserver/gs.search.people | 8b4914ac3b0cf1f467840de108ba03e3bc22c2fd | [
"ZPL-2.1"
] | null | null | null | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2012, 2013, 2014, 2015 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should ... | 35.55814 | 76 | 0.640288 | true | true | |
1c22718c15b19754974410cc60d9f7f279b75e6a | 651 | py | Python | src/OpenImg.py | Reinaldo14/Anisotropic-Diffusion | 215b138fa7a956ba73cf20c356615099822cee44 | [
"MIT"
] | null | null | null | src/OpenImg.py | Reinaldo14/Anisotropic-Diffusion | 215b138fa7a956ba73cf20c356615099822cee44 | [
"MIT"
] | null | null | null | src/OpenImg.py | Reinaldo14/Anisotropic-Diffusion | 215b138fa7a956ba73cf20c356615099822cee44 | [
"MIT"
] | null | null | null | import threading as _th
from PIL import Image
from pathlib import Path
from pylab import array,gray
extensions=[".pgm", ".png", ".jpg", "bmp"]
inputs=[Path("./input")]
images=[]
reading=_th.Lock()
def read_image(path):
with reading:
img = array(Image.open(path).convert('L'),dtype='float64'... | 21.7 | 67 | 0.615975 | import threading as _th
from PIL import Image
from pathlib import Path
from pylab import array,gray
extensions=[".pgm", ".png", ".jpg", "bmp"]
inputs=[Path("./input")]
images=[]
reading=_th.Lock()
def read_image(path):
with reading:
img = array(Image.open(path).convert('L'),dtype='float64'... | true | true |
1c227354ffad7490129798f13195bce2e1ae5d14 | 1,505 | py | Python | py_rete/filter_node.py | benthomasson/py_rete | b21e06e891991fe790c95a745cbd076aae9a426d | [
"MIT"
] | 18 | 2020-07-13T16:13:05.000Z | 2022-03-18T00:18:51.000Z | py_rete/filter_node.py | benthomasson/py_rete | b21e06e891991fe790c95a745cbd076aae9a426d | [
"MIT"
] | null | null | null | py_rete/filter_node.py | benthomasson/py_rete | b21e06e891991fe790c95a745cbd076aae9a426d | [
"MIT"
] | 6 | 2020-04-16T08:44:53.000Z | 2022-02-22T01:07:58.000Z | from __future__ import annotations
from typing import TYPE_CHECKING
import inspect
from py_rete.beta import ReteNode
from py_rete.common import V
if TYPE_CHECKING: # pragma: no cover
from typing import List
from typing import Callable
from py_rete.network import ReteNetwork
class FilterNode(ReteNode):
... | 31.354167 | 79 | 0.627907 | from __future__ import annotations
from typing import TYPE_CHECKING
import inspect
from py_rete.beta import ReteNode
from py_rete.common import V
if TYPE_CHECKING:
from typing import List
from typing import Callable
from py_rete.network import ReteNetwork
class FilterNode(ReteNode):
def __init__(... | true | true |
1c2273c8ab545db9685cc6d0015988002f48f804 | 68,222 | py | Python | certbot/cli.py | mabayhan/certbot | 2d3159848448e47ccae438e8bc35a0257762549c | [
"Apache-2.0"
] | null | null | null | certbot/cli.py | mabayhan/certbot | 2d3159848448e47ccae438e8bc35a0257762549c | [
"Apache-2.0"
] | null | null | null | certbot/cli.py | mabayhan/certbot | 2d3159848448e47ccae438e8bc35a0257762549c | [
"Apache-2.0"
] | 1 | 2020-04-09T18:24:51.000Z | 2020-04-09T18:24:51.000Z | """Certbot command line argument & config processing."""
# pylint: disable=too-many-lines
from __future__ import print_function
import argparse
import copy
import glob
import logging
import logging.handlers
import os
import sys
import configargparse
import six
import zope.component
from zope.interface import interfac... | 45.031023 | 108 | 0.639662 |
from __future__ import print_function
import argparse
import copy
import glob
import logging
import logging.handlers
import os
import sys
import configargparse
import six
import zope.component
from zope.interface import interfaces as zope_interfaces
from acme import challenges
import certbot
from certbot import c... | true | true |
1c227405099a891c9925d66ff668a8f0e25b7cac | 240 | py | Python | djangae/__init__.py | martinogden/djangae | 22610a636556c98a68200ebbeb6f1f57da42d617 | [
"BSD-3-Clause"
] | null | null | null | djangae/__init__.py | martinogden/djangae | 22610a636556c98a68200ebbeb6f1f57da42d617 | [
"BSD-3-Clause"
] | null | null | null | djangae/__init__.py | martinogden/djangae | 22610a636556c98a68200ebbeb6f1f57da42d617 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
extra_library_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "lib")
if extra_library_path not in sys.path:
sys.path.insert(1, extra_library_path)
default_app_config = 'djangae.apps.DjangaeConfig'
| 26.666667 | 84 | 0.783333 | import os
import sys
extra_library_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), "lib")
if extra_library_path not in sys.path:
sys.path.insert(1, extra_library_path)
default_app_config = 'djangae.apps.DjangaeConfig'
| true | true |
1c2275f98f9d9cdc9d5bb5d244987ef1c4b8caa5 | 14,470 | py | Python | octavia/tests/unit/controller/worker/v2/tasks/test_database_tasks_quota.py | mauroseb/octavia | 8f032d884e0f89ac69d5b6e5f5b77d19ee6eb1d7 | [
"Apache-2.0"
] | null | null | null | octavia/tests/unit/controller/worker/v2/tasks/test_database_tasks_quota.py | mauroseb/octavia | 8f032d884e0f89ac69d5b6e5f5b77d19ee6eb1d7 | [
"Apache-2.0"
] | null | null | null | octavia/tests/unit/controller/worker/v2/tasks/test_database_tasks_quota.py | mauroseb/octavia | 8f032d884e0f89ac69d5b6e5f5b77d19ee6eb1d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Rackspace, US 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 agreed to in writin... | 42.684366 | 76 | 0.595162 |
import mock
from oslo_utils import uuidutils
from taskflow.types import failure
from octavia.common import data_models
from octavia.common import exceptions
from octavia.controller.worker.v2.tasks import database_tasks
import octavia.tests.unit.base as base
class TestDatabaseTasksQuota(base.TestCase):... | true | true |
1c2277896fd2dcfcf9a713d17f27790f98391a49 | 8,105 | py | Python | LoopStructural/modelling/features/structural_frame_builder.py | vpicavet/LoopStructural | cde34fabc53b4d5cb0f8e22f53a574fac44dfbd6 | [
"MIT"
] | null | null | null | LoopStructural/modelling/features/structural_frame_builder.py | vpicavet/LoopStructural | cde34fabc53b4d5cb0f8e22f53a574fac44dfbd6 | [
"MIT"
] | null | null | null | LoopStructural/modelling/features/structural_frame_builder.py | vpicavet/LoopStructural | cde34fabc53b4d5cb0f8e22f53a574fac44dfbd6 | [
"MIT"
] | null | null | null | """
structural frame builder
"""
import logging
import numpy as np
from LoopStructural.utils import getLogger
logger = getLogger(__name__)
from LoopStructural.modelling.features.cross_product_geological_feature \
import \
CrossProductGeologicalFeature
from LoopStructural.modelling.features import \
Geol... | 40.728643 | 199 | 0.568661 |
import logging
import numpy as np
from LoopStructural.utils import getLogger
logger = getLogger(__name__)
from LoopStructural.modelling.features.cross_product_geological_feature \
import \
CrossProductGeologicalFeature
from LoopStructural.modelling.features import \
GeologicalFeatureInterpolator
from Lo... | true | true |
1c2277f6ec3412a2d53b15f253e36f43e9062b1e | 266 | py | Python | views/index/main.py | woyanh/bysj-master | d2ba7fbba7145b04e05ad3e7e14fa70018a6ce4c | [
"MIT"
] | null | null | null | views/index/main.py | woyanh/bysj-master | d2ba7fbba7145b04e05ad3e7e14fa70018a6ce4c | [
"MIT"
] | null | null | null | views/index/main.py | woyanh/bysj-master | d2ba7fbba7145b04e05ad3e7e14fa70018a6ce4c | [
"MIT"
] | null | null | null | from flask import Blueprint,render_template
index_main_bp = Blueprint('index_main',__name__)
@index_main_bp.route('/')
def index():
return render_template('index/index.html')
@index_main_bp.route('/about')
def about():
return '<h1>about</1>'
| 20.461538 | 49 | 0.695489 | from flask import Blueprint,render_template
index_main_bp = Blueprint('index_main',__name__)
@index_main_bp.route('/')
def index():
return render_template('index/index.html')
@index_main_bp.route('/about')
def about():
return '<h1>about</1>'
| true | true |
1c22783d6b217f9a83d257c0aa82944b23d8a54e | 9,949 | py | Python | MACS3/Commands/diffpeak_cmd.py | bgruening/MACS | d5c26c83cf1dbcefc1608cb36285267be018c3bb | [
"BSD-3-Clause"
] | 357 | 2015-01-18T07:45:15.000Z | 2020-05-26T12:33:17.000Z | MACS3/Commands/diffpeak_cmd.py | bgruening/MACS | d5c26c83cf1dbcefc1608cb36285267be018c3bb | [
"BSD-3-Clause"
] | 315 | 2015-01-09T20:56:44.000Z | 2020-06-02T19:26:27.000Z | MACS3/Commands/diffpeak_cmd.py | bgruening/MACS | d5c26c83cf1dbcefc1608cb36285267be018c3bb | [
"BSD-3-Clause"
] | 215 | 2015-01-18T07:45:15.000Z | 2020-05-07T20:01:49.000Z | # Time-stamp: <2020-11-24 16:48:57 Tao Liu>
"""Description: obsolete function
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file LICENSE included with
the distribution).
"""
# ------------------------------------
# python modules
# ------------------... | 38.265385 | 118 | 0.565584 |
import os
import sys
import logging
from time import strftime
logging.basicConfig(level=20,
format='%(levelname)-5s @ %(asctime)s: %(message)s ',
datefmt='%a, %d %b %Y %H:%M:%S',
stream=sys.stderr,
filemode="w"
... | true | true |
1c2278bed9a59dabd33ff1e9895f1a88aa46d399 | 3,544 | py | Python | src/color_recognition_api/color_histogram_feature_extraction.py | sujay-vittal/color-identification-cot-purdur | 1959ceb4d1965743dab4cf3b72bdc76ae4e76255 | [
"MIT"
] | null | null | null | src/color_recognition_api/color_histogram_feature_extraction.py | sujay-vittal/color-identification-cot-purdur | 1959ceb4d1965743dab4cf3b72bdc76ae4e76255 | [
"MIT"
] | null | null | null | src/color_recognition_api/color_histogram_feature_extraction.py | sujay-vittal/color-identification-cot-purdur | 1959ceb4d1965743dab4cf3b72bdc76ae4e76255 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from PIL import Image
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import itemfreq
from color_recognition_api import knn_classifier as knn_classifier
def color_histogram_of_test_image(test_src_image):
# load the image
image = test_src_image
... | 29.04918 | 75 | 0.61456 |
from PIL import Image
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import itemfreq
from color_recognition_api import knn_classifier as knn_classifier
def color_histogram_of_test_image(test_src_image):
image = test_src_image
chans = cv2.split(image)
colo... | true | true |
1c227ddce6ecaec6f97fafa26e9a5d192a7ca397 | 2,536 | py | Python | mvgcli/departures_request.py | FlorianPfisterer/mvg-cli | ad70dd909548d241b41ddc9f6f97570d0f9d4d0a | [
"MIT"
] | null | null | null | mvgcli/departures_request.py | FlorianPfisterer/mvg-cli | ad70dd909548d241b41ddc9f6f97570d0f9d4d0a | [
"MIT"
] | null | null | null | mvgcli/departures_request.py | FlorianPfisterer/mvg-cli | ad70dd909548d241b41ddc9f6f97570d0f9d4d0a | [
"MIT"
] | null | null | null | from typing import Optional, Any, Dict, List
from argparse import Namespace
from mvg_api import Station
class DeparturesRequest:
start_station_name: str
dest_station_filter: Optional[str]
offset: int
limit: int
station: Optional[Station] = None
def __init__(self, args: Optional[Namespace] = ... | 37.294118 | 113 | 0.632492 | from typing import Optional, Any, Dict, List
from argparse import Namespace
from mvg_api import Station
class DeparturesRequest:
start_station_name: str
dest_station_filter: Optional[str]
offset: int
limit: int
station: Optional[Station] = None
def __init__(self, args: Optional[Namespace] = ... | true | true |
1c227de241daf59f3a58bf68b6f38d2a912d52fd | 2,822 | py | Python | data/scratchpad.py | GavinGuan95/Punctuator.Pytorch | 65956fac30d74c537577b35cb9b95d2cf0505dfa | [
"MIT"
] | null | null | null | data/scratchpad.py | GavinGuan95/Punctuator.Pytorch | 65956fac30d74c537577b35cb9b95d2cf0505dfa | [
"MIT"
] | null | null | null | data/scratchpad.py | GavinGuan95/Punctuator.Pytorch | 65956fac30d74c537577b35cb9b95d2cf0505dfa | [
"MIT"
] | null | null | null |
import os
from google import google
import unicodedata
import io
import Levenshtein
import urllib.request
from urllib.error import HTTPError
import re
import time
import string
import sys
from bs4 import BeautifulSoup
from unidecode import unidecode
import inflect
def get_mergable(mergable_list, index, upper_thresho... | 37.131579 | 142 | 0.689227 |
import os
from google import google
import unicodedata
import io
import Levenshtein
import urllib.request
from urllib.error import HTTPError
import re
import time
import string
import sys
from bs4 import BeautifulSoup
from unidecode import unidecode
import inflect
def get_mergable(mergable_list, index, upper_thresho... | true | true |
1c227fc3bfd20002985c476df1b1c6e49d950977 | 3,767 | py | Python | test_speed.py | maria-kuruvilla/temp_collective_code | 11367dd6d70d924af0d1ea765fb95734b00253bb | [
"MIT"
] | null | null | null | test_speed.py | maria-kuruvilla/temp_collective_code | 11367dd6d70d924af0d1ea765fb95734b00253bb | [
"MIT"
] | null | null | null | test_speed.py | maria-kuruvilla/temp_collective_code | 11367dd6d70d924af0d1ea765fb95734b00253bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 3 20:41:18 2020
@author: Maria Kuruvilla
"""
import os
import pathlib
from pprint import pprint
import numpy as np
from scipy import stats
from scipy.spatial import distance
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
import trajectorytools as... | 33.336283 | 180 | 0.680382 |
import os
import pathlib
from pprint import pprint
import numpy as np
from scipy import stats
from scipy.spatial import distance
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure
import trajectorytools as tt
import trajectorytools.plot as ttplot
import trajectorytools.socialcontext as ttsocial
fr... | true | true |
1c2280d177161e424dba3fec6eb613011d70c05c | 230 | py | Python | clientes/models.py | alantinoco/django-crmsmart | f8bd3404e0dfdf4a2976ec8bbdaee27a012f9981 | [
"MIT"
] | null | null | null | clientes/models.py | alantinoco/django-crmsmart | f8bd3404e0dfdf4a2976ec8bbdaee27a012f9981 | [
"MIT"
] | null | null | null | clientes/models.py | alantinoco/django-crmsmart | f8bd3404e0dfdf4a2976ec8bbdaee27a012f9981 | [
"MIT"
] | null | null | null | from django.contrib import auth
from django.contrib.auth import authenticate
from django.db import models
from django.contrib.auth.models import User
from django.db.models.fields import DateTimeField
from escola.models import *
| 25.555556 | 49 | 0.834783 | from django.contrib import auth
from django.contrib.auth import authenticate
from django.db import models
from django.contrib.auth.models import User
from django.db.models.fields import DateTimeField
from escola.models import *
| true | true |
1c22824af9378506f69876ee0b36f5950d6f873f | 9,086 | py | Python | Informed.py | PawanSupul/PawSearch | 27bbe818d1f14dbb30e789ca891b4d2b5d2e7032 | [
"MIT"
] | 1 | 2021-01-04T08:00:37.000Z | 2021-01-04T08:00:37.000Z | Informed.py | PawanSupul/PawSearch | 27bbe818d1f14dbb30e789ca891b4d2b5d2e7032 | [
"MIT"
] | null | null | null | Informed.py | PawanSupul/PawSearch | 27bbe818d1f14dbb30e789ca891b4d2b5d2e7032 | [
"MIT"
] | null | null | null | """Informed module: Informed search algorithm definitions
This module contains informed search algorithm definitions. In here, following informed search algorithms are
defined as classes.
* GreedySearch : Greedy best first search algorithm with its helping functions
* AStarSearch : A star se... | 36.934959 | 121 | 0.59267 |
from PawSearch.base import *
class GreedySearch(object):
def __init__(self, nodes, start, goal, heuristic):
self.nodes = nodes
self.start = start
self.goal = goal
self.heuristic = heuristic
def Search(self):
ClearDiscover(self.nodes)
open_s = priorityqueue()
... | true | true |
1c2282f22a394b1a55d3ec1e518f292b551d231b | 279 | py | Python | CodeForces.com/marathons/#1/online-exam-master/generators/gen.py | mstrechen/cp | ffac439840a71f70580a0ef197e47479e167a0eb | [
"MIT"
] | null | null | null | CodeForces.com/marathons/#1/online-exam-master/generators/gen.py | mstrechen/cp | ffac439840a71f70580a0ef197e47479e167a0eb | [
"MIT"
] | null | null | null | CodeForces.com/marathons/#1/online-exam-master/generators/gen.py | mstrechen/cp | ffac439840a71f70580a0ef197e47479e167a0eb | [
"MIT"
] | null | null | null | # Author: Ivan Kazmenko (gassa@mail.ru)
import random, sys
if len (sys.argv) > 1:
seed = int (sys.argv[1])
else:
seed = random.randrange (2 ** 30)
random.seed (seed)
n = 5000
s = ''
for i in range (n):
s += chr (random.randrange (2) + ord ('0'))
sys.stdout.write (s + '\n')
| 18.6 | 44 | 0.609319 |
import random, sys
if len (sys.argv) > 1:
seed = int (sys.argv[1])
else:
seed = random.randrange (2 ** 30)
random.seed (seed)
n = 5000
s = ''
for i in range (n):
s += chr (random.randrange (2) + ord ('0'))
sys.stdout.write (s + '\n')
| true | true |
1c22843bbca683186d73c2cc0ff5997ae5d0c637 | 1,282 | py | Python | setup.py | gileno/python-pagseguro | c40f30c154cf4c80b24b6a2b8abd14cfba4ab4c3 | [
"MIT"
] | 2 | 2015-04-15T04:39:02.000Z | 2020-04-02T18:42:08.000Z | setup.py | gileno/python-pagseguro | c40f30c154cf4c80b24b6a2b8abd14cfba4ab4c3 | [
"MIT"
] | null | null | null | setup.py | gileno/python-pagseguro | c40f30c154cf4c80b24b6a2b8abd14cfba4ab4c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import codecs
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = codecs.open('README.md', encoding='utf-8').read()
with open('requirements.txt') as reqs:
requirements = reqs.read().split()
setup(
name='pagseguro',
version='0.3.... | 28.488889 | 58 | 0.635725 |
import codecs
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = codecs.open('README.md', encoding='utf-8').read()
with open('requirements.txt') as reqs:
requirements = reqs.read().split()
setup(
name='pagseguro',
version='0.3.1',
description='... | true | true |
1c2284a32ff1d0cd1915e78c3f47fee86aad4348 | 6,117 | py | Python | arjuna/tpi/guiauto/model/gns.py | bhargavkumar-65/arjuna | 400dfd598096199e89d64eb6e8d2932892d37f6d | [
"Apache-2.0"
] | 13 | 2020-05-12T06:32:51.000Z | 2022-01-24T18:21:19.000Z | arjuna/tpi/guiauto/model/gns.py | bhargavkumar-65/arjuna | 400dfd598096199e89d64eb6e8d2932892d37f6d | [
"Apache-2.0"
] | 5 | 2020-02-14T12:51:07.000Z | 2021-12-01T10:39:51.000Z | arjuna/tpi/guiauto/model/gns.py | bhargavkumar-65/arjuna | 400dfd598096199e89d64eb6e8d2932892d37f6d | [
"Apache-2.0"
] | 25 | 2020-01-16T10:44:25.000Z | 2022-02-24T13:22:22.000Z |
from arjuna.tpi.guiauto.meta.formatter import GNSLabelFormatter
from arjuna.tpi.error import *
from arjuna.core.error import *
from arjuna.interact.gui.auto.finder import GuiEmdFinder, GuiElementEmdFinder
from arjuna import track
@track("debug")
class GNS:
'''
Gui Namespace object associated with a **Gui... | 38.961783 | 151 | 0.609449 |
from arjuna.tpi.guiauto.meta.formatter import GNSLabelFormatter
from arjuna.tpi.error import *
from arjuna.core.error import *
from arjuna.interact.gui.auto.finder import GuiEmdFinder, GuiElementEmdFinder
from arjuna import track
@track("debug")
class GNS:
def __init__(self, gui_or_element, gui_def):
se... | true | true |
1c2284be2c91a0637bfd43cd3fa0114d64ac0532 | 4,418 | py | Python | pytorch_partial_crf/crf.py | kajyuuen/pytorch-partial-crf | bb368346544cb6241e425a8b4e1a3baee324ef0d | [
"MIT"
] | 22 | 2019-09-23T16:07:44.000Z | 2022-03-17T12:16:18.000Z | pytorch_partial_crf/crf.py | kajyuuen/pytorch-partial-crf | bb368346544cb6241e425a8b4e1a3baee324ef0d | [
"MIT"
] | 15 | 2019-10-20T08:23:55.000Z | 2022-03-18T00:53:33.000Z | pytorch_partial_crf/crf.py | kajyuuen/pytorch-partial-crf | bb368346544cb6241e425a8b4e1a3baee324ef0d | [
"MIT"
] | 3 | 2019-12-10T12:44:41.000Z | 2020-09-03T03:16:46.000Z | from typing import Optional
import torch
from pytorch_partial_crf.base_crf import BaseCRF
from pytorch_partial_crf.utils import log_sum_exp
class CRF(BaseCRF):
"""Conditional random field.
"""
def __init__(self, num_tags: int, padding_idx: int = None) -> None:
super().__init__(num_tags, padding_i... | 41.28972 | 111 | 0.608873 | from typing import Optional
import torch
from pytorch_partial_crf.base_crf import BaseCRF
from pytorch_partial_crf.utils import log_sum_exp
class CRF(BaseCRF):
def __init__(self, num_tags: int, padding_idx: int = None) -> None:
super().__init__(num_tags, padding_idx)
def forward(self,
... | true | true |
1c2285063ef6daef0c2c41af53d5b3da61957f1e | 26,727 | py | Python | Lib/test/test_asyncio/test_sslproto.py | hguo3/cpython | 4c26abd14f1b7242998eb2f7756aa375e0fe714f | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2019-06-19T10:34:01.000Z | 2019-06-19T10:34:01.000Z | Lib/test/test_asyncio/test_sslproto.py | hguo3/cpython | 4c26abd14f1b7242998eb2f7756aa375e0fe714f | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/test/test_asyncio/test_sslproto.py | hguo3/cpython | 4c26abd14f1b7242998eb2f7756aa375e0fe714f | [
"CNRI-Python-GPL-Compatible"
] | 2 | 2017-11-22T23:32:25.000Z | 2018-11-15T01:31:39.000Z | """Tests for asyncio/sslproto.py."""
import logging
import socket
import sys
import unittest
import weakref
from unittest import mock
try:
import ssl
except ImportError:
ssl = None
import asyncio
from asyncio import log
from asyncio import protocols
from asyncio import sslproto
from asyncio import tasks
from ... | 34.309371 | 81 | 0.587982 |
import logging
import socket
import sys
import unittest
import weakref
from unittest import mock
try:
import ssl
except ImportError:
ssl = None
import asyncio
from asyncio import log
from asyncio import protocols
from asyncio import sslproto
from asyncio import tasks
from test.test_asyncio import utils as tes... | true | true |
1c22856c1cbd8963eb417034fe8a26f3e7347bad | 9,646 | py | Python | merge_sites.py | jayhesselberth/polya | b98901585d4e33d04bfb445f5ac5faeccdd449dc | [
"MIT"
] | 1 | 2015-01-22T10:30:06.000Z | 2015-01-22T10:30:06.000Z | merge_sites.py | jayhesselberth/polya | b98901585d4e33d04bfb445f5ac5faeccdd449dc | [
"MIT"
] | null | null | null | merge_sites.py | jayhesselberth/polya | b98901585d4e33d04bfb445f5ac5faeccdd449dc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
Find the consensus of peaks among samples -- Assumes sample name is first in the
file name, delimited by either "." or "_" from the rest of the file name.
"""
import os
import sys
import tempfile
import os.path as op
import subprocess as sp
from toolshed import reader, nopen
... | 38.277778 | 93 | 0.572051 |
"""
Find the consensus of peaks among samples -- Assumes sample name is first in the
file name, delimited by either "." or "_" from the rest of the file name.
"""
import os
import sys
import tempfile
import os.path as op
import subprocess as sp
from toolshed import reader, nopen
from itertools import groupby, ifilter... | false | true |
1c2285a49e9f78711b5d449d089dc8ee9cf580c1 | 18,240 | py | Python | environments/gym_pycolab/tests/maze_walker_test.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | 12 | 2019-04-07T02:04:48.000Z | 2022-03-22T12:57:47.000Z | environments/gym_pycolab/tests/maze_walker_test.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | null | null | null | environments/gym_pycolab/tests/maze_walker_test.py | braemt/attentive-multi-task-deep-reinforcement-learning | 921feefce98076f88c892f0b7e6db8572f596763 | [
"MIT"
] | 7 | 2019-04-07T02:04:49.000Z | 2020-12-28T10:30:27.000Z | # coding=utf8
# Copyright 2017 the pycolab 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 31.502591 | 84 | 0.304002 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import unittest
from gym_pycolab import ascii_art
from gym_pycolab.prefab_parts import sprites as prefab_sprites
from gym_pycolab.tests import test_things as tt
class MazeWalkerTe... | true | true |
1c22875511e075f03b416dab43caaab4ce06a6ae | 461 | py | Python | 01-Lesson-Plans/03-Python/1/Activities/12-Stu_NumberChain-Loops/Solved/NumberChain_Solved.py | anirudhmungre/sneaky-lessons | 8e48015c50865059db96f8cd369bcc15365d66c7 | [
"ADSL"
] | 4 | 2019-10-05T03:41:20.000Z | 2020-11-04T00:39:13.000Z | 01-Lesson-Plans/03-Python/1/Activities/12-Stu_NumberChain-Loops/Solved/NumberChain_Solved.py | anirudhmungre/sneaky-lessons | 8e48015c50865059db96f8cd369bcc15365d66c7 | [
"ADSL"
] | 2 | 2021-06-02T03:14:19.000Z | 2022-02-11T23:21:24.000Z | 01-Lesson-Plans/03-Python/1/Activities/12-Stu_NumberChain-Loops/Solved/NumberChain_Solved.py | anirudhmungre/sneaky-lessons | 8e48015c50865059db96f8cd369bcc15365d66c7 | [
"ADSL"
] | 2 | 2019-10-02T14:08:51.000Z | 2019-10-03T20:49:09.000Z | # Initial variable to track game play
user_play = "y"
# While we are still playing...
while user_play == "y":
# Ask the user how many numbers to loop through
user_number = int(input("How many numbers? "))
# Loop through the numbers. (Be sure to cast the string into an integer.)
for x in range(user_nu... | 25.611111 | 77 | 0.642082 |
user_play = "y"
while user_play == "y":
user_number = int(input("How many numbers? "))
for x in range(user_number):
print(x)
user_play = input("Continue: (y)es or (n)o? ")
| true | true |
1c2288e3621536c29d26fa3f76fad6ace7cdd66f | 14,413 | py | Python | tests/test_wsgi_kerberos.py | invokesus/wsgi-kerberos | 4204c2db8562d162a78a56c0d81af8a002dae577 | [
"BSD-3-Clause"
] | null | null | null | tests/test_wsgi_kerberos.py | invokesus/wsgi-kerberos | 4204c2db8562d162a78a56c0d81af8a002dae577 | [
"BSD-3-Clause"
] | null | null | null | tests/test_wsgi_kerberos.py | invokesus/wsgi-kerberos | 4204c2db8562d162a78a56c0d81af8a002dae577 | [
"BSD-3-Clause"
] | null | null | null | from wsgi_kerberos import KerberosAuthMiddleware, ensure_bytestring, _DEFAULT_READ_MAX
from webtest import TestApp, TestRequest
import kerberos
import mock
import unittest
def index(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
response_body = 'Hello %s' % environ.get('R... | 45.181818 | 94 | 0.659613 | from wsgi_kerberos import KerberosAuthMiddleware, ensure_bytestring, _DEFAULT_READ_MAX
from webtest import TestApp, TestRequest
import kerberos
import mock
import unittest
def index(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
response_body = 'Hello %s' % environ.get('R... | true | true |
1c2288e62e252dca0f342f85aacdac62b1ca846c | 726 | py | Python | gbpservice/contrib/nfp/configurator/lib/fw_constants.py | ansao-aci/group-based-policy | d80a94dcb51bfce6994cd18339d3c79a7cb54bfe | [
"Apache-2.0"
] | 2 | 2017-12-13T10:33:28.000Z | 2019-07-03T19:01:42.000Z | gbpservice/contrib/nfp/configurator/lib/fw_constants.py | ansao-aci/group-based-policy | d80a94dcb51bfce6994cd18339d3c79a7cb54bfe | [
"Apache-2.0"
] | 4 | 2015-04-14T00:27:44.000Z | 2020-08-31T11:20:17.000Z | gbpservice/contrib/nfp/configurator/lib/fw_constants.py | ansao-aci/group-based-policy | d80a94dcb51bfce6994cd18339d3c79a7cb54bfe | [
"Apache-2.0"
] | 4 | 2015-04-10T16:03:47.000Z | 2020-08-31T06:06:32.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
# d... | 40.333333 | 78 | 0.749311 |
SERVICE_TYPE = 'firewall'
FIREWALL_CREATE_EVENT = 'CREATE_FIREWALL'
FIREWALL_UPDATE_EVENT = 'UPDATE_FIREWALL'
FIREWALL_DELETE_EVENT = 'DELETE_FIREWALL'
| true | true |
1c22892fb8fabe7f665a75ae55af8fd47a2a6cb1 | 206 | py | Python | Assignments/Basic Syntax Conditional Statements and Loops/Lab/05. Patterns.py | KaloyankerR/python-fundamentals-repository | b8e69523ea7e6aa352e8398f0202e283374a0f7c | [
"MIT"
] | null | null | null | Assignments/Basic Syntax Conditional Statements and Loops/Lab/05. Patterns.py | KaloyankerR/python-fundamentals-repository | b8e69523ea7e6aa352e8398f0202e283374a0f7c | [
"MIT"
] | null | null | null | Assignments/Basic Syntax Conditional Statements and Loops/Lab/05. Patterns.py | KaloyankerR/python-fundamentals-repository | b8e69523ea7e6aa352e8398f0202e283374a0f7c | [
"MIT"
] | null | null | null | size = int(input())
current = 1
step = 1
for row in range(size * 2):
for col in range(0, current):
print('*', end='')
if current == size:
step = -1
current += step
print()
| 15.846154 | 33 | 0.514563 | size = int(input())
current = 1
step = 1
for row in range(size * 2):
for col in range(0, current):
print('*', end='')
if current == size:
step = -1
current += step
print()
| true | true |
1c228a3a7dceb44ec6677a0a9c8482eed7030b89 | 773 | py | Python | laalaa/apps/advisers/migrations/0004_auto_20150407_1228.py | ministryofjustice/laa-legal-adviser-api | 4420a339e0d6cb31f825c34a39c872b72bed2f0b | [
"MIT"
] | 2 | 2020-03-10T10:31:32.000Z | 2022-01-13T10:32:26.000Z | laalaa/apps/advisers/migrations/0004_auto_20150407_1228.py | ministryofjustice/laa-legal-adviser-api | 4420a339e0d6cb31f825c34a39c872b72bed2f0b | [
"MIT"
] | 109 | 2015-03-31T14:06:22.000Z | 2022-01-24T17:21:49.000Z | laalaa/apps/advisers/migrations/0004_auto_20150407_1228.py | ministryofjustice/laa-legal-adviser-api | 4420a339e0d6cb31f825c34a39c872b72bed2f0b | [
"MIT"
] | 3 | 2019-02-18T12:46:03.000Z | 2021-06-10T09:15:55.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [("advisers", "0003_organisation_firm")]
operations = [
migrations.AddField(
model_name="category", name="civil", field=models.B... | 30.92 | 111 | 0.644243 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [("advisers", "0003_organisation_firm")]
operations = [
migrations.AddField(
model_name="category", name="civil", field=models.BooleanField(default=Tru... | true | true |
1c228a71224132a138da7d8e971373dc0e10e5e2 | 69,464 | py | Python | ops/pebble.py | sed-i/operator | ace323a379ff0f8937a3a5f2eb1a6d8592004455 | [
"Apache-2.0"
] | null | null | null | ops/pebble.py | sed-i/operator | ace323a379ff0f8937a3a5f2eb1a6d8592004455 | [
"Apache-2.0"
] | null | null | null | ops/pebble.py | sed-i/operator | ace323a379ff0f8937a3a5f2eb1a6d8592004455 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 36.929293 | 98 | 0.585829 |
import binascii
import cgi
import datetime
import email.parser
import enum
import http.client
import io
import json
import os
import re
import select
import shutil
import signal
import socket
import sys
import threading
import time
import typing
import urllib.error
import urllib.parse
import urllib.reque... | true | true |
1c228ad1b3d804116c8a82f5801e2ca8da61dbda | 64 | py | Python | HackerRank/Problem Solving/Matching Anything But a Newline.py | AkashSCIENTIST/CompetitiveSolutions | 236db303a21c7195ebf721394a54ce9df70782f5 | [
"Apache-2.0"
] | null | null | null | HackerRank/Problem Solving/Matching Anything But a Newline.py | AkashSCIENTIST/CompetitiveSolutions | 236db303a21c7195ebf721394a54ce9df70782f5 | [
"Apache-2.0"
] | null | null | null | HackerRank/Problem Solving/Matching Anything But a Newline.py | AkashSCIENTIST/CompetitiveSolutions | 236db303a21c7195ebf721394a54ce9df70782f5 | [
"Apache-2.0"
] | null | null | null | regex_pattern = r"^...\....\....\....$" # Do not delete 'r'.
| 21.333333 | 61 | 0.40625 | regex_pattern = r"^...\....\....\....$"
| true | true |
1c228b27442b47d09c40a08a55d9306f025adb36 | 4,025 | py | Python | third_party/chromite/lib/launch_control/launch_control.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/chromite/lib/launch_control/launch_control.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/chromite/lib/launch_control/launch_control.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Select an Android build, and download symbols for it."""
from __future__ import print_function
from chromite.lib import andro... | 35 | 80 | 0.713043 |
from __future__ import print_function
from chromite.lib import androidbuild
from chromite.lib import commandline
from chromite.lib import cros_logging as logging
def OpenBuildApiProxy(json_key_file):
creds = androidbuild.LoadCredentials(json_credentials_path=json_key_file)
return androidbuild.GetApiClie... | true | true |
1c228b3f9f770bd6b588727aa11a3969f69bd7dc | 6,828 | py | Python | load_data.py | junfengwen/DARN | 585fc99b9ed23b7c0835a2d47713016cf6333260 | [
"MIT"
] | 11 | 2020-08-03T08:18:25.000Z | 2022-03-29T15:42:38.000Z | load_data.py | silvia1993/DARN | 585fc99b9ed23b7c0835a2d47713016cf6333260 | [
"MIT"
] | null | null | null | load_data.py | silvia1993/DARN | 585fc99b9ed23b7c0835a2d47713016cf6333260 | [
"MIT"
] | 8 | 2020-09-12T04:47:54.000Z | 2021-09-04T15:27:37.000Z | import os
import numpy as np
from scipy.sparse import coo_matrix
def load_numpy_data(name,
data_path,
logger):
if name == "amazon":
data_names = ["books", "dvd", "electronics", "kitchen"]
input_dim = 5000 # Number of features to be used in the experiment... | 41.381818 | 116 | 0.555507 | import os
import numpy as np
from scipy.sparse import coo_matrix
def load_numpy_data(name,
data_path,
logger):
if name == "amazon":
data_names = ["books", "dvd", "electronics", "kitchen"]
input_dim = 5000
num_trains = 2000
amaz... | true | true |
1c228d083eebbd52514fcf9d5ff32da30f56f2b3 | 15,354 | py | Python | svb/http_client.py | fuziontech/svb | a36760da7dcdbbd720cd0649b202a71af096c1bf | [
"MIT"
] | null | null | null | svb/http_client.py | fuziontech/svb | a36760da7dcdbbd720cd0649b202a71af096c1bf | [
"MIT"
] | null | null | null | svb/http_client.py | fuziontech/svb | a36760da7dcdbbd720cd0649b202a71af096c1bf | [
"MIT"
] | null | null | null | import os
import sys
import textwrap
import warnings
import email
from svb import error, util
from svb.six import iteritems, string_types
from svb.six.moves import urllib
# - Requests is the preferred HTTP library
# - Google App Engine has urlfetch
# - Use Pycurl if it's there (at least it verifies SSL certs)
# - Fal... | 39.880519 | 79 | 0.57783 | import os
import sys
import textwrap
import warnings
import email
from svb import error, util
from svb.six import iteritems, string_types
from svb.six.moves import urllib
# - Fall back to urllib2 with a warning if needed
try:
import urllib2
except ImportError:
# Try to load in urllib2, but don't sweat it i... | true | true |
1c228d3ff91e943bd0146f2356ca1c21f203614f | 2,529 | py | Python | scale_example.py | edwintcloud/Grapevine_DB | 376f74320ae8a76d09193b6ac464d6120ea6b9c3 | [
"MIT"
] | 2 | 2020-08-28T19:16:51.000Z | 2020-09-05T01:37:12.000Z | scale_example.py | edwintcloud/Grapevine_DB | 376f74320ae8a76d09193b6ac464d6120ea6b9c3 | [
"MIT"
] | 2 | 2019-08-12T00:17:22.000Z | 2019-08-19T03:12:39.000Z | scale_example.py | edwintcloud/GrapevineDB | 376f74320ae8a76d09193b6ac464d6120ea6b9c3 | [
"MIT"
] | null | null | null | from database import Database
from random import shuffle
from time import time as timer
if __name__ == "__main__":
d = Database()
try:
times = {}
d.wipe()
# create 10 collections
start = timer()
cols = []
for n in range(10):
cols.append(d.add(f"colle... | 27.791209 | 77 | 0.498616 | from database import Database
from random import shuffle
from time import time as timer
if __name__ == "__main__":
d = Database()
try:
times = {}
d.wipe()
start = timer()
cols = []
for n in range(10):
cols.append(d.add(f"collection{n}"))
... | true | true |
1c228d6440562f3c685830e9fc63a689acce89e7 | 4,639 | py | Python | predict.py | ialab-puc/pytorch-segmentation-toolbox | cc52d5ff7a41bae1f47ebe76b2908a84723fda93 | [
"MIT"
] | 2 | 2022-03-30T08:55:15.000Z | 2022-03-30T08:55:45.000Z | predict.py | ialab-puc/pytorch-segmentation-toolbox | cc52d5ff7a41bae1f47ebe76b2908a84723fda93 | [
"MIT"
] | null | null | null | predict.py | ialab-puc/pytorch-segmentation-toolbox | cc52d5ff7a41bae1f47ebe76b2908a84723fda93 | [
"MIT"
] | 1 | 2020-02-20T15:40:37.000Z | 2020-02-20T15:40:37.000Z | import argparse
import scipy
from scipy import ndimage
import cv2
import numpy as np
import sys
import json
import torch
from torch.autograd import Variable
import torchvision.models as models
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from torch.utils import data
import networks
from datase... | 38.02459 | 117 | 0.656607 | import argparse
import scipy
from scipy import ndimage
import cv2
import numpy as np
import sys
import json
import torch
from torch.autograd import Variable
import torchvision.models as models
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from torch.utils import data
import networks
from datase... | true | true |
1c228e2d64bdca77ef2e25d2d20151461ee11584 | 4,990 | py | Python | tests/common/output/test_get_exit_code.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | null | null | null | tests/common/output/test_get_exit_code.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | 3 | 2020-02-07T19:51:40.000Z | 2022-03-21T05:06:29.000Z | tests/common/output/test_get_exit_code.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | null | null | null | import unittest
from checkov.common.models.enums import CheckResult
from checkov.common.output.report import Report
from checkov.common.output.record import Record
class TestGetExitCode(unittest.TestCase):
def test_get_exit_code(self):
record1 = Record(check_id='CKV_AWS_157',
b... | 50.918367 | 117 | 0.561323 | import unittest
from checkov.common.models.enums import CheckResult
from checkov.common.output.report import Report
from checkov.common.output.record import Record
class TestGetExitCode(unittest.TestCase):
def test_get_exit_code(self):
record1 = Record(check_id='CKV_AWS_157',
b... | true | true |
1c228f451cad8a092739bee4ab2dbcd2b7443e1f | 302 | py | Python | library/admin.py | sharif-42/django-elasticsearch | 999ee3382ef2ddcfcc62bd7ba330323000f3f1bf | [
"MIT"
] | null | null | null | library/admin.py | sharif-42/django-elasticsearch | 999ee3382ef2ddcfcc62bd7ba330323000f3f1bf | [
"MIT"
] | null | null | null | library/admin.py | sharif-42/django-elasticsearch | 999ee3382ef2ddcfcc62bd7ba330323000f3f1bf | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Author, Book
@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
list_display = ['title', 'id', 'author', 'isbn']
@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
list_display = ['author_name', 'first_name', 'email', ]
| 21.571429 | 59 | 0.718543 | from django.contrib import admin
from .models import Author, Book
@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
list_display = ['title', 'id', 'author', 'isbn']
@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
list_display = ['author_name', 'first_name', 'email', ]
| true | true |
1c228f847c6cde91635a3b847756e27911659487 | 1,273 | py | Python | osu/models/models_util.py | brandondong/osu-beatmap-generator | 7ca14793ef6a48a65cfd1a564f3b24d940a6051a | [
"MIT"
] | null | null | null | osu/models/models_util.py | brandondong/osu-beatmap-generator | 7ca14793ef6a48a65cfd1a564f3b24d940a6051a | [
"MIT"
] | 1 | 2021-06-01T23:50:59.000Z | 2021-06-01T23:50:59.000Z | osu/models/models_util.py | brandondong/osu-beatmap-generator | 7ca14793ef6a48a65cfd1a564f3b24d940a6051a | [
"MIT"
] | null | null | null | from enum import Enum
import os
import pickle
import numpy as np
TRAINING_METADATA_PATH = "training_data/metadata/"
MODEL_SAVE_PATH = "models/weights/"
class MetadataPredictor(Enum):
CS = "cs"
DRAIN = "drain"
ACCURACY = "accuracy"
AR = "ar"
def load_metadata_dataset():
"""Loads the metadata training dataset i... | 27.085106 | 104 | 0.72663 | from enum import Enum
import os
import pickle
import numpy as np
TRAINING_METADATA_PATH = "training_data/metadata/"
MODEL_SAVE_PATH = "models/weights/"
class MetadataPredictor(Enum):
CS = "cs"
DRAIN = "drain"
ACCURACY = "accuracy"
AR = "ar"
def load_metadata_dataset():
files = os.listdir(TRAINING_METADATA_PA... | true | true |
1c229068971c51e4e82a14ccb13d692091b51807 | 9,482 | py | Python | examples/protection/virus_total_connector.py | mtmcgrew/cbapi-python | 6e81507ff30a57eb1f13ae829c28e6ee339d2ad1 | [
"MIT"
] | null | null | null | examples/protection/virus_total_connector.py | mtmcgrew/cbapi-python | 6e81507ff30a57eb1f13ae829c28e6ee339d2ad1 | [
"MIT"
] | 1 | 2021-03-31T19:51:07.000Z | 2021-03-31T19:51:07.000Z | examples/protection/virus_total_connector.py | deepakmishraapi/cbresponse | 420fa05d0f7b9d61e5682d7a69a4098f6c32e61c | [
"MIT"
] | null | null | null | #!/usr/bin/python
from cbapi.six import iteritems
from cbapi.six.moves.configparser import RawConfigParser
from cbapi.protection import Connector, Notification, PendingAnalysis
from cbapi.example_helpers import get_cb_protection_object, build_cli_parser
import requests
import tempfile
import shutil
import datetime
imp... | 39.840336 | 118 | 0.631934 |
from cbapi.six import iteritems
from cbapi.six.moves.configparser import RawConfigParser
from cbapi.protection import Connector, Notification, PendingAnalysis
from cbapi.example_helpers import get_cb_protection_object, build_cli_parser
import requests
import tempfile
import shutil
import datetime
import logging
impor... | true | true |
1c229070c7a6499360d5670321162fa2fadb8747 | 4,956 | py | Python | app/main/jbei_ice_functions.py | charlestondance/amoslims | c1d051db3e88a92644446744a9027c5699f52b02 | [
"MIT"
] | null | null | null | app/main/jbei_ice_functions.py | charlestondance/amoslims | c1d051db3e88a92644446744a9027c5699f52b02 | [
"MIT"
] | 7 | 2020-03-24T15:56:29.000Z | 2022-01-13T00:48:15.000Z | app/main/jbei_ice_functions.py | charlestondance/amoslims | c1d051db3e88a92644446744a9027c5699f52b02 | [
"MIT"
] | null | null | null | from Bio.Seq import Seq
from Bio import SeqIO, SeqFeature
from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA
import requests, json
from dna_features_viewer import BiopythonTranslator
from dna_features_viewer import (GraphicFeature, GraphicRecord,
CircularGraphicRecord)
from dnacauldron im... | 33.261745 | 117 | 0.720743 | from Bio.Seq import Seq
from Bio import SeqIO, SeqFeature
from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA
import requests, json
from dna_features_viewer import BiopythonTranslator
from dna_features_viewer import (GraphicFeature, GraphicRecord,
CircularGraphicRecord)
from dnacauldron im... | true | true |
1c2290741100f1fa0c37f27375742ed34900df8d | 279 | py | Python | api/urls.py | Lambda-School-Labs/space_race | 9589215a82275d232292a990b90f49285910ebf8 | [
"MIT"
] | null | null | null | api/urls.py | Lambda-School-Labs/space_race | 9589215a82275d232292a990b90f49285910ebf8 | [
"MIT"
] | 9 | 2018-05-22T21:20:25.000Z | 2021-07-19T23:20:21.000Z | api/urls.py | BloomTech-Labs/space_race | 9589215a82275d232292a990b90f49285910ebf8 | [
"MIT"
] | 6 | 2018-05-21T16:37:35.000Z | 2019-09-18T09:48:04.000Z | from django.urls import include, path
urlpatterns = [
path('rest-auth/', include('rest_auth.urls')),
path('rest-auth/registration/', include('rest_auth.registration.urls')),
path('accounts/', include('accounts.urls')),
path('paypay/', include('paypay.urls')),
]
| 31 | 76 | 0.673835 | from django.urls import include, path
urlpatterns = [
path('rest-auth/', include('rest_auth.urls')),
path('rest-auth/registration/', include('rest_auth.registration.urls')),
path('accounts/', include('accounts.urls')),
path('paypay/', include('paypay.urls')),
]
| true | true |
1c2290de7d455643e095947222b90b80c8db4f96 | 4,496 | py | Python | tests.py | Arzybek/cubes | 63f7f32c5d793e64e0d49eb13fc4eb5fc30a009f | [
"MIT"
] | 1 | 2019-02-23T09:40:23.000Z | 2019-02-23T09:40:23.000Z | tests.py | Arzybek/cubes | 63f7f32c5d793e64e0d49eb13fc4eb5fc30a009f | [
"MIT"
] | null | null | null | tests.py | Arzybek/cubes | 63f7f32c5d793e64e0d49eb13fc4eb5fc30a009f | [
"MIT"
] | null | null | null | import unittest
import cubes
import config as cfg
class OrdersTestCase(unittest.TestCase):
def setUp(self):
cfg.map_width = 4
cfg.map_height = 4
cfg.count_colors = 2
self.cubes = cubes.Cubes()
self.cubes.create_cubes()
def test_order_height(self):
... | 35.68254 | 80 | 0.520463 | import unittest
import cubes
import config as cfg
class OrdersTestCase(unittest.TestCase):
def setUp(self):
cfg.map_width = 4
cfg.map_height = 4
cfg.count_colors = 2
self.cubes = cubes.Cubes()
self.cubes.create_cubes()
def test_order_height(self):
... | true | true |
1c2290e2b4ee6f99fafa29a6e85dbc815160ff61 | 1,687 | py | Python | moclo-ecoflex/moclo/registry/ecoflex.py | althonos/automoclo | 63c131a6fa501fe62c564ad33cee0df91df9790e | [
"MIT"
] | null | null | null | moclo-ecoflex/moclo/registry/ecoflex.py | althonos/automoclo | 63c131a6fa501fe62c564ad33cee0df91df9790e | [
"MIT"
] | null | null | null | moclo-ecoflex/moclo/registry/ecoflex.py | althonos/automoclo | 63c131a6fa501fe62c564ad33cee0df91df9790e | [
"MIT"
] | null | null | null | # coding: utf-8
"""EcoFlex ToolKit sequences registry.
Sequences were obtained from two sources:
* The EcoFlex plasmid files distributed with the kit in a zip archive,
available under the *Protocol & Resources* tab of the EcoFlex repository.
* The individual plasmid files from their dedicated AddGene webpages, using... | 32.442308 | 82 | 0.749852 |
from __future__ import absolute_import
from __future__ import unicode_literals
import six
from ..kits import ecoflex
from .base import EmbeddedRegistry
from ._utils import find_resistance
class EcoFlexRegistry(EmbeddedRegistry):
_module = __name__
_file = "ecoflex.tar.gz"
_VECTORS = {
"pTU1":... | true | true |
1c229139076aeaf32d79b083bde4a5c6f20ddfe0 | 272 | py | Python | zappy/__init__.py | asmodehn/zappy | cda1023fe8a0027ea6df9b9e5efad6e0005bb5a1 | [
"MIT"
] | 1 | 2018-07-17T07:50:13.000Z | 2018-07-17T07:50:13.000Z | zappy/__init__.py | asmodehn/zappy | cda1023fe8a0027ea6df9b9e5efad6e0005bb5a1 | [
"MIT"
] | null | null | null | zappy/__init__.py | asmodehn/zappy | cda1023fe8a0027ea6df9b9e5efad6e0005bb5a1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for Zappy."""
__author__ = """AlexV"""
__email__ = 'asmodehn@gmail.com'
__version__ = '0.1.0' # TODO : separate version file for setup.py to grab it.
from .pure import ZAPImpurityDetected, pure
from .stacker import Stacker
| 24.727273 | 78 | 0.694853 |
__author__ = """AlexV"""
__email__ = 'asmodehn@gmail.com'
__version__ = '0.1.0'
from .pure import ZAPImpurityDetected, pure
from .stacker import Stacker
| true | true |
1c22918b2efd89df68e5d062e3587587354bf6d5 | 2,335 | py | Python | pandas/tests/tseries/holiday/test_observance.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | 80 | 2015-01-01T17:32:11.000Z | 2022-01-24T07:17:47.000Z | pandas/tests/tseries/holiday/test_observance.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | 1 | 2018-04-04T16:46:41.000Z | 2018-04-04T16:46:41.000Z | pandas/tests/tseries/holiday/test_observance.py | developing-coder/pandas | 9feb3ad92cc0397a04b665803a49299ee7aa1037 | [
"BSD-3-Clause"
] | 28 | 2015-01-30T16:07:48.000Z | 2022-02-11T18:41:13.000Z | from datetime import datetime
import pytest
from pandas.tseries.holiday import (
after_nearest_workday, before_nearest_workday, nearest_workday,
next_monday, next_monday_or_tuesday, next_workday, previous_friday,
previous_workday, sunday_to_monday, weekend_to_monday)
_WEDNESDAY = datetime(2014, 4, 9)
_TH... | 24.840426 | 71 | 0.721199 | from datetime import datetime
import pytest
from pandas.tseries.holiday import (
after_nearest_workday, before_nearest_workday, nearest_workday,
next_monday, next_monday_or_tuesday, next_workday, previous_friday,
previous_workday, sunday_to_monday, weekend_to_monday)
_WEDNESDAY = datetime(2014, 4, 9)
_TH... | true | true |
1c2291a7a41d8996cfce70c2cdb4ab7a107997d3 | 2,439 | py | Python | stdlib/datetime_qs/broadcast_cal_utils.py | bpuderer/python-snippets27 | 8d51ff34c48bee1247575536d8ed506eafde8631 | [
"MIT"
] | 3 | 2015-11-20T14:30:53.000Z | 2015-12-19T05:55:19.000Z | stdlib/datetime_qs/broadcast_cal_utils.py | bpuderer/python-snippets27 | 8d51ff34c48bee1247575536d8ed506eafde8631 | [
"MIT"
] | null | null | null | stdlib/datetime_qs/broadcast_cal_utils.py | bpuderer/python-snippets27 | 8d51ff34c48bee1247575536d8ed506eafde8631 | [
"MIT"
] | 1 | 2016-01-05T20:54:49.000Z | 2016-01-05T20:54:49.000Z | """util functions for broadcast calendar
https://en.wikipedia.org/wiki/Broadcast_calendar
"""
from datetime import date, timedelta
def broadcast_month_start(year, month):
"""return start date of broadcast month. always on monday"""
start_date = date(year, month, 1)
while start_date.weekday() != 0:
... | 30.4875 | 78 | 0.639196 |
from datetime import date, timedelta
def broadcast_month_start(year, month):
start_date = date(year, month, 1)
while start_date.weekday() != 0:
start_date -= timedelta(days=1)
return start_date
def quarter_start_month(quarter):
if quarter not in range(1, 5):
raise ValueError("invalid... | true | true |
1c2294c748fa611ae3fcdc3c508aee6ea88c637a | 7,799 | py | Python | tests/attr/neuron/test_neuron_conductance.py | Europium248/captum | ac02fae2651b8d68a44bcb9d03b91cbb3959f2fc | [
"BSD-3-Clause"
] | null | null | null | tests/attr/neuron/test_neuron_conductance.py | Europium248/captum | ac02fae2651b8d68a44bcb9d03b91cbb3959f2fc | [
"BSD-3-Clause"
] | null | null | null | tests/attr/neuron/test_neuron_conductance.py | Europium248/captum | ac02fae2651b8d68a44bcb9d03b91cbb3959f2fc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import unittest
from typing import Any, List, Tuple, Union, cast
import torch
from torch import Tensor
from torch.nn import Module
from captum._utils.typing import BaselineType, TensorOrTupleOfTensorsGeneric
from captum.attr._core.layer.layer_conductance import LayerConductance
from captum.att... | 38.800995 | 88 | 0.561739 |
import unittest
from typing import Any, List, Tuple, Union, cast
import torch
from torch import Tensor
from torch.nn import Module
from captum._utils.typing import BaselineType, TensorOrTupleOfTensorsGeneric
from captum.attr._core.layer.layer_conductance import LayerConductance
from captum.attr._core.neuron.neuron_... | true | true |
1c229558a50cb1d30c65809413d3d0fca2701308 | 5,244 | py | Python | recognize.py | ercan-akar/chessboard-recognizer | 8ce2e782a400d2e5fb8c492442b0989741e996b3 | [
"MIT"
] | 42 | 2019-12-09T22:26:18.000Z | 2022-03-07T03:46:49.000Z | recognize.py | ercan-akar/chessboard-recognizer | 8ce2e782a400d2e5fb8c492442b0989741e996b3 | [
"MIT"
] | 11 | 2020-10-04T18:20:06.000Z | 2022-03-31T18:36:55.000Z | recognize.py | ercan-akar/chessboard-recognizer | 8ce2e782a400d2e5fb8c492442b0989741e996b3 | [
"MIT"
] | 12 | 2020-03-14T23:35:05.000Z | 2022-01-29T12:04:55.000Z | #!/usr/bin/env python3
import sys
from glob import glob
from io import BytesIO
from functools import reduce
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
from tensorflow.keras import models
import numpy as np
from constants import (
TILES_DIR, NN_MODEL_PATH, FEN_CHARS, USE_GRAYSCALE,... | 37.191489 | 98 | 0.646644 |
import sys
from glob import glob
from io import BytesIO
from functools import reduce
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
from tensorflow.keras import models
import numpy as np
from constants import (
TILES_DIR, NN_MODEL_PATH, FEN_CHARS, USE_GRAYSCALE, DETECT_CORNERS
)
from... | true | true |
1c22958b5da58114bf18a0e45de477a5643814cf | 5,519 | py | Python | Editor/Scripts/add_dccsi.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 2 | 2021-07-18T11:20:41.000Z | 2022-02-01T20:17:50.000Z | Editor/Scripts/add_dccsi.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 5 | 2021-07-14T02:24:07.000Z | 2021-10-04T21:24:35.000Z | Editor/Scripts/add_dccsi.py | incisor/o3de-atomtest | 026fef06827bf0dd559510882df5cb426ab00a99 | [
"Apache-2.0",
"MIT"
] | 7 | 2021-07-06T18:21:14.000Z | 2021-12-06T09:12:40.000Z | # coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
# -- This line is 75 characters ------------------------------------------... | 42.453846 | 99 | 0.619859 |
import sys
import os
import site
import pathlib
from pathlib import Path
import logging as _logging
import azlmbr
_PROJECT = 'AtomTest'
_MODULE = f'{_PROJECT}.add_dccsi'
_LY_DEV = os.getenv('LY_DEV', None)
if not _LY_DEV:
_LY_DEV = Path(azlmbr.paths.engroot)
os.environ['LY_DEV'] = pathlib.P... | true | true |
1c2295da261557b278f6a1974efa4c8f2ad23f8b | 6,145 | py | Python | tempest/tests/lib/services/identity/v3/test_token_client.py | ssundari/tempest | 205ce1e686ca9f90d8c1fcb63c8337dd233cb2aa | [
"Apache-2.0"
] | 254 | 2015-01-05T19:22:52.000Z | 2022-03-29T08:14:54.000Z | tempest/tests/lib/services/identity/v3/test_token_client.py | ssundari/tempest | 205ce1e686ca9f90d8c1fcb63c8337dd233cb2aa | [
"Apache-2.0"
] | 13 | 2015-03-02T15:53:04.000Z | 2022-02-16T02:28:14.000Z | tempest/tests/lib/services/identity/v3/test_token_client.py | ssundari/tempest | 205ce1e686ca9f90d8c1fcb63c8337dd233cb2aa | [
"Apache-2.0"
] | 367 | 2015-01-07T15:05:39.000Z | 2022-03-04T09:50:35.000Z | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 39.140127 | 77 | 0.542718 |
from unittest import mock
from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client
from tempest.lib import exceptions
from tempest.lib.services.identity.v3 import token_client
from tempest.tests import base
from tempest.tests.lib import fake_identity
class TestTokenC... | true | true |
1c22965435dc71431dca7a0f4ec2a6d43c646aca | 14,852 | py | Python | scripts/python-config-script/relay.py | hobpet/sr201 | 44352930e7464d307f4e99183c3def202e6a85d2 | [
"MIT"
] | 23 | 2016-08-11T10:38:14.000Z | 2021-09-17T13:22:11.000Z | scripts/python-config-script/relay.py | hobpet/sr201 | 44352930e7464d307f4e99183c3def202e6a85d2 | [
"MIT"
] | 9 | 2016-12-08T17:13:37.000Z | 2022-02-04T23:48:08.000Z | scripts/python-config-script/relay.py | hobpet/sr201 | 44352930e7464d307f4e99183c3def202e6a85d2 | [
"MIT"
] | 18 | 2017-06-23T15:38:42.000Z | 2021-05-03T09:30:22.000Z | #!/usr/bin/python3
#
# SYNOPSIS
# sr-201-relay.py relay-hostname [command...]
#
#
# DESCRIPTION
#
# Configures and controls a SR-201 Ethernet relay. If no commands are given
# 'config' is assumed. If you don't supply relay-hostname a short help
# message will be issued listing the available commands.
#
# BUGS... | 34.459397 | 120 | 0.548007 |
# message will be issued listing the available commands.
#
# BUGS
#
# Although this program can be used to issue control commands to the relay
# I recommend doing it directly instead. It will be be faster, more
# reliable, and the task is so simple the code will be shorter. The
# primary purpose o... | true | true |
1c229775da087587f7736687a2cfebf3a1c61407 | 1,790 | py | Python | tests/test_setup.py | mlf-core/system-intelligence | f1241dbb9783f6277c7f22327a532486b9876263 | [
"Apache-2.0"
] | 6 | 2020-06-23T10:41:17.000Z | 2021-08-09T07:02:50.000Z | tests/test_setup.py | mlf-core/system-intelligence | f1241dbb9783f6277c7f22327a532486b9876263 | [
"Apache-2.0"
] | 161 | 2020-06-12T14:53:37.000Z | 2022-03-31T21:02:07.000Z | tests/test_setup.py | mlf-core/system-intelligence | f1241dbb9783f6277c7f22327a532486b9876263 | [
"Apache-2.0"
] | null | null | null | """Tests for setup scripts."""
import importlib
import itertools
import pathlib
import runpy
import subprocess
import sys
import types
import typing as t
def run_program(*args, glob: bool = False):
"""Run subprocess with given args. Use path globbing for each arg that contains an asterisk."""
if glob:
... | 30.862069 | 99 | 0.686592 |
import importlib
import itertools
import pathlib
import runpy
import subprocess
import sys
import types
import typing as t
def run_program(*args, glob: bool = False):
if glob:
cwd = pathlib.Path.cwd()
args = tuple(itertools.chain.from_iterable(
list(str(_.relative_to(cwd)) for _ in cw... | true | true |
1c229a9749fe0a396db51105cf32bab322f8b658 | 960 | py | Python | budget/setup.py | seanbreckenridge/mint | d19cb5cf28c584f3c3efe322fe154bea243a7eed | [
"MIT"
] | null | null | null | budget/setup.py | seanbreckenridge/mint | d19cb5cf28c584f3c3efe322fe154bea243a7eed | [
"MIT"
] | 3 | 2021-03-15T09:48:30.000Z | 2022-02-14T06:02:01.000Z | budget/setup.py | seanbreckenridge/mint | d19cb5cf28c584f3c3efe322fe154bea243a7eed | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages # type: ignore[import]
requirements = [
"logzero",
"click",
"IPython",
"more-itertools",
"gitpython",
"pick",
"pyfiglet",
"pandas",
"tabulate",
"vimbuffer>=0.1.3",
"scipy",
"numpy",
"matplotlib",
"tzlocal",
]
setup(
... | 24.615385 | 73 | 0.604167 | from setuptools import setup, find_packages
requirements = [
"logzero",
"click",
"IPython",
"more-itertools",
"gitpython",
"pick",
"pyfiglet",
"pandas",
"tabulate",
"vimbuffer>=0.1.3",
"scipy",
"numpy",
"matplotlib",
"tzlocal",
]
setup(
name="budget",
... | true | true |
1c229aef419aeaec52ed4672ecd72f648cc77bc2 | 304 | py | Python | recipe_modules/milo/__init__.py | luci/recipes-py | 13b77f0e1dc3e0f15f540679262ce966917c15a3 | [
"Apache-2.0"
] | 23 | 2016-01-20T00:45:26.000Z | 2022-02-26T04:25:30.000Z | recipe_modules/milo/__init__.py | luci/recipes-py | 13b77f0e1dc3e0f15f540679262ce966917c15a3 | [
"Apache-2.0"
] | 8 | 2016-01-15T19:00:38.000Z | 2018-03-06T00:15:24.000Z | recipe_modules/milo/__init__.py | luci/recipes-py | 13b77f0e1dc3e0f15f540679262ce966917c15a3 | [
"Apache-2.0"
] | 13 | 2015-09-05T05:52:43.000Z | 2019-07-08T17:34:27.000Z | # Copyright 2020 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'json',
'path',
'platform',
'raw_io',
'runtime',
'step',
'uuid',
]
| 19 | 75 | 0.677632 |
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'json',
'path',
'platform',
'raw_io',
'runtime',
'step',
'uuid',
]
| true | true |
1c229b3e1201bcc61ad4bee557833eb6dd536abe | 352 | py | Python | app/networks.py | de-conf/arduino.io | 50b5ddcf8b3032ffdeb857bcd9a125441239a77b | [
"MIT"
] | 4 | 2020-01-06T23:29:52.000Z | 2022-02-04T22:53:30.000Z | app/networks.py | de-conf/arduino.io | 50b5ddcf8b3032ffdeb857bcd9a125441239a77b | [
"MIT"
] | 1 | 2021-04-06T14:46:10.000Z | 2021-04-07T14:50:53.000Z | app/networks.py | de-conf/arduino.io | 50b5ddcf8b3032ffdeb857bcd9a125441239a77b | [
"MIT"
] | 1 | 2020-01-20T07:12:35.000Z | 2020-01-20T07:12:35.000Z | import socket
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.connect(('10.255.255.255', 1))
ip = s.getsockname()[0]
except ConnectionError:
print("check your connection -> DATABASE will be localhost")
ip = '127.0.0.1'
finally:
s.close(... | 11.354839 | 68 | 0.5625 | import socket
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.connect(('10.255.255.255', 1))
ip = s.getsockname()[0]
except ConnectionError:
print("check your connection -> DATABASE will be localhost")
ip = '127.0.0.1'
finally:
s.close(... | true | true |
1c229b5c4165647f443619092cf289341880647c | 166 | py | Python | deployments/biology/image/ipython_config.py | ryanlovett/datahub | 6be4525b7f7dde499fe953d2453cbe4f34b954a3 | [
"BSD-3-Clause"
] | 104 | 2017-08-14T18:29:34.000Z | 2022-03-09T16:38:28.000Z | deployments/biology/image/ipython_config.py | ryanlovett/datahub | 6be4525b7f7dde499fe953d2453cbe4f34b954a3 | [
"BSD-3-Clause"
] | 793 | 2017-08-16T21:49:14.000Z | 2022-03-31T01:14:41.000Z | deployments/biology/image/ipython_config.py | ryanlovett/datahub | 6be4525b7f7dde499fe953d2453cbe4f34b954a3 | [
"BSD-3-Clause"
] | 129 | 2017-08-10T01:26:31.000Z | 2022-02-03T01:24:19.000Z | # Disable history manager, we don't really use it
# and by default it puts an sqlite file on NFS, which is not something we wanna do
c.Historymanager.enabled = False
| 41.5 | 82 | 0.771084 |
# and by default it puts an sqlite file on NFS, which is not something we wanna do
c.Historymanager.enabled = False
| true | true |
1c229ba5095815571488dbf0a9779d3ff1c00439 | 1,272 | py | Python | setup.py | MERTULAS/learn | 66b96e06019ddca3b4fade12fa365d581207345d | [
"MIT"
] | 1 | 2021-03-31T16:17:39.000Z | 2021-03-31T16:17:39.000Z | setup.py | theBerkk/learned | 66b96e06019ddca3b4fade12fa365d581207345d | [
"MIT"
] | null | null | null | setup.py | theBerkk/learned | 66b96e06019ddca3b4fade12fa365d581207345d | [
"MIT"
] | 1 | 2021-06-23T21:41:56.000Z | 2021-06-23T21:41:56.000Z | import setuptools
url = "https://github.com/MERTULAS/learned"
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(name="learned",
version="0.5.4.5",
description="Package containing deep learning model, classic machine learning model... | 43.862069 | 155 | 0.543239 | import setuptools
url = "https://github.com/MERTULAS/learned"
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(name="learned",
version="0.5.4.5",
description="Package containing deep learning model, classic machine learning model... | true | true |
1c229bba4c5bae6cfdd2f1da1d86be022a5d6a06 | 10,294 | py | Python | keras/esim_init.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | 1 | 2020-05-22T02:03:34.000Z | 2020-05-22T02:03:34.000Z | keras/esim_init.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | null | null | null | keras/esim_init.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | 1 | 2019-12-04T14:29:23.000Z | 2019-12-04T14:29:23.000Z | import os
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
import pandas as pd
import numpy as np
from tqdm import tqdm
import time
import logging
from sklearn.model_selection import StratifiedKFold
from keras_bert import load_trained_model_from_checkpoint, Tokenizer
from keras.optimizers import Adam
import pandas as... | 37.028777 | 108 | 0.615407 | import os
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
import pandas as pd
import numpy as np
from tqdm import tqdm
import time
import logging
from sklearn.model_selection import StratifiedKFold
from keras_bert import load_trained_model_from_checkpoint, Tokenizer
from keras.optimizers import Adam
import pandas as... | true | true |
1c229bf272221160cce9b0c42bd407a2b7bd5f69 | 397 | py | Python | deploy/doaj_static_gunicorn_config.py | gaybro8777/doaj | 27d9d98ce4f496ae52acbaba6ee8e42c84cf1a58 | [
"Apache-2.0"
] | 47 | 2015-04-24T13:13:39.000Z | 2022-03-06T03:22:42.000Z | deploy/doaj_static_gunicorn_config.py | gaybro8777/doaj | 27d9d98ce4f496ae52acbaba6ee8e42c84cf1a58 | [
"Apache-2.0"
] | 1,215 | 2015-01-02T14:29:38.000Z | 2022-03-28T14:19:13.000Z | deploy/doaj_static_gunicorn_config.py | gaybro8777/doaj | 27d9d98ce4f496ae52acbaba6ee8e42c84cf1a58 | [
"Apache-2.0"
] | 14 | 2015-11-27T13:01:23.000Z | 2021-05-21T07:57:23.000Z | bind = "0.0.0.0:5051"
workers = 2
proc_name = 'doaj (static)'
max_requests = 1000
# The maximum jitter to add to the max_requests setting.
#
# The jitter causes the restart per worker to be randomized by
# randint(0, max_requests_jitter)
# This is intended to stagger worker restarts to avoid all workers restarting at ... | 26.466667 | 95 | 0.763224 | bind = "0.0.0.0:5051"
workers = 2
proc_name = 'doaj (static)'
max_requests = 1000
max_requests_jitter = 100
timeout = 40
graceful_timeout = 40
| true | true |
1c229bf6791b34c64760d1fc4dc995a1e2c1bbf1 | 1,238 | py | Python | tests/test_exceptions.py | DavidChoi76/hydrofunctions | 631f7d1dc8b6990fae5f250530fa401e76a0e214 | [
"MIT"
] | 46 | 2016-10-04T14:54:56.000Z | 2022-02-25T23:13:07.000Z | tests/test_exceptions.py | DavidChoi76/hydrofunctions | 631f7d1dc8b6990fae5f250530fa401e76a0e214 | [
"MIT"
] | 90 | 2018-02-01T20:47:29.000Z | 2022-01-13T13:03:58.000Z | tests/test_exceptions.py | DavidChoi76/hydrofunctions | 631f7d1dc8b6990fae5f250530fa401e76a0e214 | [
"MIT"
] | 24 | 2016-11-30T18:10:20.000Z | 2022-01-09T21:44:13.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 12 21:55:04 2016
test_exceptions.py
"""
from __future__ import absolute_import, print_function, division, unicode_literals
import unittest
import warnings
from hydrofunctions import exceptions
def raiseHydroNoDataError():
raise exceptions.HydroNoDataError("Error!!"... | 28.136364 | 82 | 0.723748 |
from __future__ import absolute_import, print_function, division, unicode_literals
import unittest
import warnings
from hydrofunctions import exceptions
def raiseHydroNoDataError():
raise exceptions.HydroNoDataError("Error!!")
class TestExceptions(unittest.TestCase):
def test_exceptions_HydroNoDataError_c... | true | true |
1c229d6bcb14f2dbad13b3d092bbf6bc123f8181 | 7,062 | py | Python | dygraph/slowfast/eval.py | weiwei1115/models | e2c96c5f64b1dc8f0d5d9aa121300b87150e11e3 | [
"Apache-2.0"
] | 1 | 2021-03-29T04:25:22.000Z | 2021-03-29T04:25:22.000Z | dygraph/slowfast/eval.py | weiwei1115/models | e2c96c5f64b1dc8f0d5d9aa121300b87150e11e3 | [
"Apache-2.0"
] | null | null | null | dygraph/slowfast/eval.py | weiwei1115/models | e2c96c5f64b1dc8f0d5d9aa121300b87150e11e3 | [
"Apache-2.0"
] | 1 | 2021-06-09T01:50:13.000Z | 2021-06-09T01:50:13.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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... | 36.78125 | 92 | 0.614982 |
import os
import sys
import argparse
import ast
import logging
import numpy as np
import paddle.fluid as fluid
from paddle.fluid.dygraph.base import to_variable
from paddle.io import DataLoader, Dataset, DistributedBatchSampler
from paddle.hapi.model import _all_gather
from paddle.fluid.dygraph.parallel i... | true | true |
1c229d796d279c41eb93b660b5c7735adc5c638c | 3,384 | py | Python | npt/utils/cv_utils.py | yonip97/non-parametric-transformers | 33fc744ce78a97024443f1e0080a8849fc43dbb7 | [
"Apache-2.0"
] | 302 | 2021-06-06T16:44:18.000Z | 2022-03-23T08:05:47.000Z | npt/utils/cv_utils.py | jlko/non-parametric-transformers | f748b898a47b6dbd1ad1aa9aee9fc5b200e23030 | [
"Apache-2.0"
] | 2 | 2021-07-02T09:59:45.000Z | 2021-08-03T11:52:10.000Z | npt/utils/cv_utils.py | jlko/non-parametric-transformers | f748b898a47b6dbd1ad1aa9aee9fc5b200e23030 | [
"Apache-2.0"
] | 29 | 2021-06-06T16:44:21.000Z | 2022-03-31T09:18:32.000Z | """Cross-validation utils."""
from collections import Counter
from enum import IntEnum
import numpy as np
from sklearn.model_selection import StratifiedKFold, train_test_split, KFold
class DatasetMode(IntEnum):
"""Used in batching."""
TRAIN = 0
VAL = 1
TEST = 2
DATASET_MODE_TO_ENUM = {
'train'... | 32.228571 | 76 | 0.641253 |
from collections import Counter
from enum import IntEnum
import numpy as np
from sklearn.model_selection import StratifiedKFold, train_test_split, KFold
class DatasetMode(IntEnum):
TRAIN = 0
VAL = 1
TEST = 2
DATASET_MODE_TO_ENUM = {
'train': DatasetMode.TRAIN,
'val': DatasetMode.VAL,
'test... | true | true |
1c229eb492bf39502bd35071295fc39747df7012 | 1,158 | py | Python | python/waf_toggle.py | aca2328/devops | 1517ab839e0d9e8beaae359230f099aa786d02d7 | [
"Apache-2.0"
] | 72 | 2017-03-17T04:24:05.000Z | 2022-02-22T10:35:48.000Z | python/waf_toggle.py | aca2328/devops | 1517ab839e0d9e8beaae359230f099aa786d02d7 | [
"Apache-2.0"
] | 28 | 2017-09-05T23:49:18.000Z | 2022-03-29T18:56:06.000Z | python/waf_toggle.py | aca2328/devops | 1517ab839e0d9e8beaae359230f099aa786d02d7 | [
"Apache-2.0"
] | 139 | 2017-03-21T13:28:38.000Z | 2022-03-30T11:25:39.000Z | #!/usr/bin/python3
#example PATCH request script to turn off waf policy on vs
#requires avisdk packages. install here #requires avisdk packages. install here https://github.com/avinetworks/sdk/tree/master/python/avi/sdk
#API token generation needed. for token generation help, see https://avinetworks.com/docs/18.2/saas... | 41.357143 | 141 | 0.740069 |
min"
controller_ip = "InsertControllerIP"
vs_name = "InsertVSnameHere"
request_body = '{ "replace": {"waf_policy_ref": "" }}'
with ApiSession(controller_ip, user, token=token, tenant=tenant) as session:
vs_obj = session.get_object_by_name('virtualservice', vs_name)
if vs_obj:
resp... | true | true |
1c229fa8a84912cb66d433c03de117426b3d1aca | 6,425 | py | Python | Schoolworks/ArtificialIntelligence/julei.py | cuihaoleo/exercises | 401dc2f19b6474e84e357a79a53754684fc93784 | [
"WTFPL"
] | 1 | 2015-08-30T10:06:41.000Z | 2015-08-30T10:06:41.000Z | Schoolworks/ArtificialIntelligence/julei.py | cuihaoleo/exercises | 401dc2f19b6474e84e357a79a53754684fc93784 | [
"WTFPL"
] | null | null | null | Schoolworks/ArtificialIntelligence/julei.py | cuihaoleo/exercises | 401dc2f19b6474e84e357a79a53754684fc93784 | [
"WTFPL"
] | null | null | null | from types import SimpleNamespace
from collections import Counter
import numpy as np
import pandas as pd
from pandas.tools.plotting import andrews_curves, radviz, parallel_coordinates
import matplotlib.pyplot as plt
import argparse
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
from scipy.spat... | 28.555556 | 78 | 0.584591 | from types import SimpleNamespace
from collections import Counter
import numpy as np
import pandas as pd
from pandas.tools.plotting import andrews_curves, radviz, parallel_coordinates
import matplotlib.pyplot as plt
import argparse
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
from scipy.spat... | true | true |
1c229fad016fdf7b98c3d376b06c6e3de77a7718 | 21,364 | py | Python | 6.006 Introduction to Algorithms MIT OCW/Assignments/ps2_sol/circuit.py | SiyuIsaacParkerTian/self_learning | 662b27c60cbfad94d80bd40f46e9f2d0f4270826 | [
"MIT"
] | null | null | null | 6.006 Introduction to Algorithms MIT OCW/Assignments/ps2_sol/circuit.py | SiyuIsaacParkerTian/self_learning | 662b27c60cbfad94d80bd40f46e9f2d0f4270826 | [
"MIT"
] | null | null | null | 6.006 Introduction to Algorithms MIT OCW/Assignments/ps2_sol/circuit.py | SiyuIsaacParkerTian/self_learning | 662b27c60cbfad94d80bd40f46e9f2d0f4270826 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import json # Used when TRACE=jsonp
import os # Used to get the TRACE environment variable
import re # Used when TRACE=jsonp
import sys # Used to smooth over the range / xrange issue.
# Python 3 doesn't have xrange, and range behaves like xrange.
if sys.version_info >= (3,):
xra... | 35.845638 | 92 | 0.570118 |
import json
import os
import re
import sys
if sys.version_info >= (3,):
xrange = range
# Circuit simulation library.
class TruthTable:
def __init__(self, name, output_list):
self.name = name
self.table = self._build_table(output_list)
self.input_count = self.... | true | true |
1c22a12469b487a47ba2149e1d89c0586cd20af1 | 539 | py | Python | notebooks/import_test_notebooks.py | vvandriichuk/etl_spark_airflow_emr | 0c793ca67389a789c8eb1f487fe3a384e714ff3b | [
"MIT"
] | 3 | 2021-01-02T01:18:39.000Z | 2021-06-09T19:52:38.000Z | notebooks/import_test_notebooks.py | philippschmalen/etl_spark_airflow_emr | 0c793ca67389a789c8eb1f487fe3a384e714ff3b | [
"MIT"
] | null | null | null | notebooks/import_test_notebooks.py | philippschmalen/etl_spark_airflow_emr | 0c793ca67389a789c8eb1f487fe3a384e714ff3b | [
"MIT"
] | 3 | 2021-06-12T04:06:33.000Z | 2021-12-01T17:48:38.000Z | import pandas as pd
import numpy as np
from sys import version
print(f"Python version: {version}")
query_return_length = 261
keywords = [i for i in range(20)]
# # create empty df with 0s
df_zeros = pd.DataFrame(np.zeros((query_return_length*len(keywords), 3)), columns=['date','keyword', 'search_interest'])
# repl... | 26.95 | 120 | 0.745826 | import pandas as pd
import numpy as np
from sys import version
print(f"Python version: {version}")
query_return_length = 261
keywords = [i for i in range(20)]
np.zeros((query_return_length*len(keywords), 3)), columns=['date','keyword', 'search_interest'])
df_zeros['keyword'] = np.repeat(keywords, query_return_le... | true | true |
1c22a1248ed321d349a4fd74a330466070c8e294 | 4,033 | py | Python | sdk/python/pulumi_azure_native/operationsmanagement/get_management_configuration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/operationsmanagement/get_management_configuration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/operationsmanagement/get_management_configuration.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 33.608333 | 164 | 0.6546 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
__all__ = [
'GetManagementConfigurationResult',
'AwaitableGetManagementConfigurationResult',
'get_management_configuration',
]
@pulumi... | true | true |
1c22a1fd6f8585b66990b4ca1482e96207a70737 | 1,772 | py | Python | KiBuzzard/deps/fonttools/Lib/fontTools/ttLib/tables/L_T_S_H_.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 240 | 2021-01-11T14:49:24.000Z | 2022-03-29T22:33:49.000Z | KiBuzzard/deps/fonttools/Lib/fontTools/ttLib/tables/L_T_S_H_.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 77 | 2021-01-12T20:23:30.000Z | 2022-03-28T12:14:34.000Z | KiBuzzard/deps/fonttools/Lib/fontTools/ttLib/tables/L_T_S_H_.py | HDR/KiBuzzard | b9e2cff0783b7cda9b8d68f2d2b5077b48d3a838 | [
"MIT"
] | 28 | 2021-01-17T05:44:11.000Z | 2022-01-11T19:58:46.000Z | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.textTools import safeEval
from . import DefaultTable
import struct
import array
# XXX I've lowered the strictness, to make sure Apple's own Chicago
# XXX gets through. They're looking into it, I hope ... | 32.814815 | 75 | 0.704853 | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc.textTools import safeEval
from . import DefaultTable
import struct
import array
# XXX back to normal eventually.
class table_L_T_S_H_(DefaultTable.DefaultTable):
def decompile(self, data, ttFont)... | true | true |
1c22a3008b686e38d648d53911e6bc95f9216a64 | 194 | py | Python | relay/common/utils.py | phaesoo/relay | 1f95d2567a5cb6927302a98307f9e78b58949468 | [
"MIT"
] | null | null | null | relay/common/utils.py | phaesoo/relay | 1f95d2567a5cb6927302a98307f9e78b58949468 | [
"MIT"
] | null | null | null | relay/common/utils.py | phaesoo/relay | 1f95d2567a5cb6927302a98307f9e78b58949468 | [
"MIT"
] | null | null | null | from flask import request, current_app as app
def get_config(key):
val = app.config.get(key)
if val is None:
raise ValueError("Invalid config: {}".format(key))
return val
| 19.4 | 58 | 0.664948 | from flask import request, current_app as app
def get_config(key):
val = app.config.get(key)
if val is None:
raise ValueError("Invalid config: {}".format(key))
return val
| true | true |
1c22a31fbdc140b877c436fe4eac7ae8ee4cb1aa | 3,962 | py | Python | MetReg/models/dl/layers/constrain.py | leelew/MetReg | b38e28326374e30521eab70625b9c22105688d8d | [
"MIT"
] | 3 | 2021-02-18T02:28:09.000Z | 2022-02-27T14:31:38.000Z | MetReg/models/dl/layers/constrain.py | leelew/MetReg | b38e28326374e30521eab70625b9c22105688d8d | [
"MIT"
] | null | null | null | MetReg/models/dl/layers/constrain.py | leelew/MetReg | b38e28326374e30521eab70625b9c22105688d8d | [
"MIT"
] | 1 | 2021-11-17T10:41:48.000Z | 2021-11-17T10:41:48.000Z | import tensorflow as tf
class Constrain(tf.keras.layers.Layer):
"""Constrain layer Type 1
combine center cropping & space to channel & average pooling
to constrain the info from space into channel.
input:
- 5D: (batch_size, timesteps, height, width, channels)
output... | 32.211382 | 78 | 0.508077 | import tensorflow as tf
class Constrain(tf.keras.layers.Layer):
def __init__(self):
super().__init__()
def build(self, input_shape):
self.avg_pool_1 = tf.keras.layers.AveragePooling2D()
self.crop_1 = tf.keras.layers.Cropping2D(
cropping=((int(input_sha... | true | true |
1c22a3e81f232e7df60a44512b9def3e109dde30 | 6,092 | py | Python | aerosandbox/optimization/opti.py | hdolfen/AeroSandbox | 4c48690e31f5f2006937352a63d653fe268c42c3 | [
"MIT"
] | null | null | null | aerosandbox/optimization/opti.py | hdolfen/AeroSandbox | 4c48690e31f5f2006937352a63d653fe268c42c3 | [
"MIT"
] | null | null | null | aerosandbox/optimization/opti.py | hdolfen/AeroSandbox | 4c48690e31f5f2006937352a63d653fe268c42c3 | [
"MIT"
] | null | null | null | import casadi as cas
from typing import Union, List
import numpy as np
import pytest
class Opti(cas.Opti):
def __init__(self,
variable_categories_to_freeze=[],
):
super().__init__()
p_opts = {}
s_opts = {}
s_opts["max_iter"] = 3000
s_opts["... | 44.794118 | 123 | 0.608995 | import casadi as cas
from typing import Union, List
import numpy as np
import pytest
class Opti(cas.Opti):
def __init__(self,
variable_categories_to_freeze=[],
):
super().__init__()
p_opts = {}
s_opts = {}
s_opts["max_iter"] = 3000
s_opts["... | true | true |
1c22a4be4d5b0c4633dae9ce95dd2959bc8bc347 | 449 | py | Python | payments/migrations/0005_auto_20190327_2248.py | tanmayag8958/upes-fipi-jigyasa | e05e41e7624175ae64216a54cc546bbb74b2df61 | [
"MIT"
] | 8 | 2019-03-08T10:28:38.000Z | 2019-10-17T00:04:44.000Z | payments/migrations/0005_auto_20190327_2248.py | tanmayag8958/upes-fipi-jigyasa | e05e41e7624175ae64216a54cc546bbb74b2df61 | [
"MIT"
] | 124 | 2020-02-11T23:51:09.000Z | 2022-01-13T01:06:09.000Z | payments/migrations/0005_auto_20190327_2248.py | tanmayag8958/upes-fipi-jigyasa | e05e41e7624175ae64216a54cc546bbb74b2df61 | [
"MIT"
] | 3 | 2019-03-07T18:44:55.000Z | 2019-03-08T10:36:50.000Z | # Generated by Django 2.1.7 on 2019-03-27 17:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('payments', '0004_auto_20190310_0141'),
]
operations = [
migrations.AlterField(
model_name='paytm_history',
name='BAN... | 23.631579 | 102 | 0.625835 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('payments', '0004_auto_20190310_0141'),
]
operations = [
migrations.AlterField(
model_name='paytm_history',
name='BANKTXNID',
field=models.CharField(bla... | true | true |
1c22a548c5fa6af31828fb04c9615b46ade1e39b | 882 | py | Python | chacha/db.py | cns-iu/myaura | ba7973d1102c9ecc8223e8471fd50c7cd29fadc8 | [
"MIT"
] | null | null | null | chacha/db.py | cns-iu/myaura | ba7973d1102c9ecc8223e8471fd50c7cd29fadc8 | [
"MIT"
] | 12 | 2020-07-17T01:20:10.000Z | 2022-01-13T15:46:14.000Z | chacha/db.py | cns-iu/myaura | ba7973d1102c9ecc8223e8471fd50c7cd29fadc8 | [
"MIT"
] | null | null | null | # coding=utf-8
# Author: Rion B Correia
# Date: 25 June 2019
#
# Description: Database Connection
import os
import json
import sqlalchemy
#
# Load DB Configuration File
#
with open(os.path.join(os.path.dirname(__file__), 'db_config.json')) as f:
CONFIGS = json.load(f)
def connectToMySQL(server, verbose=False, *... | 26.727273 | 93 | 0.679138 |
import os
import json
import sqlalchemy
with open(os.path.join(os.path.dirname(__file__), 'db_config.json')) as f:
CONFIGS = json.load(f)
def connectToMySQL(server, verbose=False, *args, **kwargs):
if server not in CONFIGS:
raise ValueError('Database server `%s` not defined in `db_confi... | true | true |
1c22a6c900aa6c9564e809b7a978385eb710fa3d | 33,766 | py | Python | Bio/SearchIO/BlastIO/blast_tab.py | bioinf-mcb/biopython | 1a1f4a7ee4e0efba517d3d607c56c27e72e399cc | [
"BSD-3-Clause"
] | 5 | 2015-06-14T17:01:57.000Z | 2020-10-05T03:27:56.000Z | Bio/SearchIO/BlastIO/blast_tab.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 14 | 2021-03-26T20:54:22.000Z | 2021-04-06T17:18:53.000Z | Bio/SearchIO/BlastIO/blast_tab.py | uci-ics-32/biopython | ff7d3703d442192a1f6d84c52e028d566d44ff1c | [
"BSD-3-Clause"
] | 8 | 2016-02-20T22:53:21.000Z | 2022-02-04T06:10:23.000Z | # Copyright 2012 by Wibowo Arindrarto. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Bio.SearchIO pars... | 37.727374 | 101 | 0.550791 |
import re
from Bio.SearchIO._index import SearchIndexer
from Bio.SearchIO._model import QueryResult, Hit, HSP, HSPFragment
__all__ = ("BlastTabIndexer", "BlastTabParser", "BlastTabWriter")
_LONG_SHORT_MAP = {
"query id": "qseqid",
"query acc.": "qacc",
"query acc.ver": "qaccver",
"query ... | true | true |
1c22a73b1d34e02135d668461ecda81c0157d8f3 | 22,649 | py | Python | tools/infer/utility.py | tienln4/PaddleOCR-1 | 786448503b3f23140798bdecde19e985027257b2 | [
"DOC",
"Apache-2.0"
] | null | null | null | tools/infer/utility.py | tienln4/PaddleOCR-1 | 786448503b3f23140798bdecde19e985027257b2 | [
"DOC",
"Apache-2.0"
] | null | null | null | tools/infer/utility.py | tienln4/PaddleOCR-1 | 786448503b3f23140798bdecde19e985027257b2 | [
"DOC",
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 38.782534 | 104 | 0.59411 |
import argparse
import os
import sys
import cv2
import numpy as np
import json
from PIL import Image, ImageDraw, ImageFont
import math
from paddle import inference
import time
from ppocr.utils.logging import get_logger
def str2bool(v):
return v.lower() in ("true", "t", "1")
def init_args():
pa... | true | true |
1c22a80ce6f616a691e87b5ded8078bd939e0684 | 324 | py | Python | packages/pyre/filesystem/InfoZipFolder.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/filesystem/InfoZipFolder.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/filesystem/InfoZipFolder.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2018 all rights reserved
#
# superclass
from .InfoZip import InfoZip
from .InfoFolder import InfoFolder
# class declaration
class InfoZipFolder(InfoZip, InfoFolder):
"""
Representation of zip filesystem directories
"""
# end of f... | 14.727273 | 48 | 0.697531 |
from .InfoZip import InfoZip
from .InfoFolder import InfoFolder
class InfoZipFolder(InfoZip, InfoFolder):
| true | true |
1c22a829376122ec90224435a996fb0f159819fc | 9,626 | py | Python | grouptesting/simulator.py | bryantower/google-research | 2d5dc20e96152566d0876977e4fb974724f406a6 | [
"Apache-2.0"
] | 1 | 2020-05-26T17:25:09.000Z | 2020-05-26T17:25:09.000Z | grouptesting/simulator.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | null | null | null | grouptesting/simulator.py | JustinDurham/google-research | 9049acf9246c1b75170f0c6757e62a8f619a9db6 | [
"Apache-2.0"
] | 1 | 2020-05-24T21:08:49.000Z | 2020-05-24T21:08:49.000Z | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... | 37.74902 | 80 | 0.658945 |
import time
from typing import Iterable, Union
from absl import logging
import gin
import jax
import jax.numpy as np
import numpy as onp
import pandas as pd
from grouptesting import metrics
from grouptesting import policy as group_policy
from grouptesting import state
from grouptesting import wet_lab... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.