hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f1773306c4663c050422782eae8b880a2e7440 | 14,865 | py | Python | main.py | MrtnMndt/OCDVAEContinualLearning | 2c5f778dc7f94ff696b923a84246a56c391a8eff | [
"MIT"
] | 22 | 2020-03-13T08:16:15.000Z | 2021-07-09T14:18:13.000Z | main.py | MrtnMndt/OCDVAEContinualLearning | 2c5f778dc7f94ff696b923a84246a56c391a8eff | [
"MIT"
] | null | null | null | main.py | MrtnMndt/OCDVAEContinualLearning | 2c5f778dc7f94ff696b923a84246a56c391a8eff | [
"MIT"
] | 6 | 2020-03-13T08:16:18.000Z | 2021-07-21T07:59:21.000Z | ########################
# Importing libraries
########################
# System libraries
import os
import random
from time import gmtime, strftime
import numpy as np
import pickle
# Tensorboard for PyTorch logging and visualization
from torch.utils.tensorboard import SummaryWriter
# Torch libraries
import torch
imp... | 46.453125 | 117 | 0.631483 | lib.Training.loss_functions import unified_loss_function as criterion
from lib.Utility.utils import save_checkpoint, save_task_checkpoint
from lib.Training.evaluate import get_latent_embedding
from lib.Utility.visualization import args_to_tensorboard
from lib.Utility.visualization import visualize_dataset_in_2d_embeddi... | true | true |
f7f17856476cdec4b6e81f7c5251d31025129c1e | 4,500 | py | Python | FW/edk2-ws/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5/src/lib/krb5/ccache/t_cccol.py | daxx-linux/edk-Lab_Material_FW | 0c92b0b861e33d949a73e3be96929570e6c7ec61 | [
"BSD-2-Clause"
] | 1 | 2022-02-16T01:28:20.000Z | 2022-02-16T01:28:20.000Z | FW/edk2-ws/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5/src/lib/krb5/ccache/t_cccol.py | daxx-linux/edk-Lab_Material_FW | 0c92b0b861e33d949a73e3be96929570e6c7ec61 | [
"BSD-2-Clause"
] | null | null | null | FW/edk2-ws/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5/src/lib/krb5/ccache/t_cccol.py | daxx-linux/edk-Lab_Material_FW | 0c92b0b861e33d949a73e3be96929570e6c7ec61 | [
"BSD-2-Clause"
] | 2 | 2021-07-04T02:59:41.000Z | 2021-07-18T08:07:16.000Z | #!/usr/bin/python
from k5test import *
realm = K5Realm(create_kdb=False)
keyctl = which('keyctl')
out = realm.run([klist, '-c', 'KEYRING:process:abcd'], expected_code=1)
test_keyring = (keyctl is not None and
'Unknown credential cache type' not in out)
if not test_keyring:
skipped('keyring collect... | 37.5 | 79 | 0.656667 |
from k5test import *
realm = K5Realm(create_kdb=False)
keyctl = which('keyctl')
out = realm.run([klist, '-c', 'KEYRING:process:abcd'], expected_code=1)
test_keyring = (keyctl is not None and
'Unknown credential cache type' not in out)
if not test_keyring:
skipped('keyring collection tests', 'keyr... | true | true |
f7f179be9aa6fc657e0ace7359e13bea7cfd9d18 | 4,556 | py | Python | models.py | NashDisequilibrium/00_Conference_Central | 194727df081a1bb08c4dcd828e634a74c1d7e1b7 | [
"Apache-2.0"
] | null | null | null | models.py | NashDisequilibrium/00_Conference_Central | 194727df081a1bb08c4dcd828e634a74c1d7e1b7 | [
"Apache-2.0"
] | null | null | null | models.py | NashDisequilibrium/00_Conference_Central | 194727df081a1bb08c4dcd828e634a74c1d7e1b7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... | 34.515152 | 86 | 0.699517 |
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protorpc import messages
from google.appengine.ext import ndb
class ConflictException(endpoints.ServiceException):
http_status = httplib.CONFLICT
class Profile(ndb.Model):
displayName = ndb.StringProperty()
mainEmail... | true | true |
f7f17a7c6df1340eb7c0edcffc8e8da51543d778 | 1,043 | py | Python | django_sourcerer/domain/import_datas/intermediate_layer.py | nokia-wroclaw/innovativeproject-django-sourcerer | 955f360e98826c736ae6b2072e304a26ca3fffb3 | [
"MIT"
] | 2 | 2020-03-11T10:54:43.000Z | 2020-05-22T11:05:53.000Z | django_sourcerer/domain/import_datas/intermediate_layer.py | nokia-wroclaw/innovativeproject-django-sourcerer | 955f360e98826c736ae6b2072e304a26ca3fffb3 | [
"MIT"
] | 8 | 2020-03-31T14:15:44.000Z | 2021-09-22T18:42:44.000Z | django_sourcerer/domain/import_datas/intermediate_layer.py | nokia-wroclaw/innovativeproject-django-sourcerer | 955f360e98826c736ae6b2072e304a26ca3fffb3 | [
"MIT"
] | null | null | null | from django_sourcerer.domain.import_datas import parsing_config_file
from django_sourcerer.domain.import_datas.jsonHandler import JsonHandler
from django_sourcerer.domain.import_datas.csvHandler import CsvHandler
from django_sourcerer.domain.import_datas.importer import Importer
class Adapter(object):
_handler = ... | 32.59375 | 89 | 0.704698 | from django_sourcerer.domain.import_datas import parsing_config_file
from django_sourcerer.domain.import_datas.jsonHandler import JsonHandler
from django_sourcerer.domain.import_datas.csvHandler import CsvHandler
from django_sourcerer.domain.import_datas.importer import Importer
class Adapter(object):
_handler = ... | true | true |
f7f17aedc2bbe6d1cd7ae7f1bf148fb11113afe7 | 3,292 | py | Python | xarray/ufuncs.py | kaipak/xarray | 9ae7bce99ce33555d2e40e24e9c0ef5047eeef8f | [
"Apache-2.0"
] | null | null | null | xarray/ufuncs.py | kaipak/xarray | 9ae7bce99ce33555d2e40e24e9c0ef5047eeef8f | [
"Apache-2.0"
] | null | null | null | xarray/ufuncs.py | kaipak/xarray | 9ae7bce99ce33555d2e40e24e9c0ef5047eeef8f | [
"Apache-2.0"
] | null | null | null | """xarray specific universal functions
Handles unary and binary operations for the following types, in ascending
priority order:
- scalars
- numpy.ndarray
- dask.array.Array
- xarray.Variable
- xarray.DataArray
- xarray.Dataset
- xarray.core.groupby.GroupBy
Once NumPy 1.10 comes out with support for overriding ufuncs... | 35.782609 | 78 | 0.643074 | from __future__ import absolute_import, division, print_function
import numpy as _np
from .core.dataarray import DataArray as _DataArray
from .core.dataset import Dataset as _Dataset
from .core.duck_array_ops import _dask_or_eager_func
from .core.groupby import GroupBy as _GroupBy
from .core.pycompat import dask_arra... | true | true |
f7f17baf6404899900a424d7fece110b04ab75a4 | 3,566 | py | Python | HMM clustering/em.py | nikgetas/brain_parcellation_project | 59fa6b976b23250d111f0e2a8683152639be5051 | [
"MIT"
] | null | null | null | HMM clustering/em.py | nikgetas/brain_parcellation_project | 59fa6b976b23250d111f0e2a8683152639be5051 | [
"MIT"
] | null | null | null | HMM clustering/em.py | nikgetas/brain_parcellation_project | 59fa6b976b23250d111f0e2a8683152639be5051 | [
"MIT"
] | null | null | null | import copy
import distributions
import kmeans
import numpy as np
import matplotlib.pyplot as plt
import sys
from matplotlib.mlab import bivariate_normal
from numpy import newaxis as nax
from numpy.linalg import det, inv
from IPython.core.debugger import Tracer
def log_likelihood(X, obs_distr, pi):
N = X.shape[0]... | 31.557522 | 83 | 0.603197 | import copy
import distributions
import kmeans
import numpy as np
import matplotlib.pyplot as plt
import sys
from matplotlib.mlab import bivariate_normal
from numpy import newaxis as nax
from numpy.linalg import det, inv
from IPython.core.debugger import Tracer
def log_likelihood(X, obs_distr, pi):
N = X.shape[0]... | true | true |
f7f17bf367c6e9b38c657c0575a1154c5b509bf8 | 72 | py | Python | conduit/models/self_supervised/moco/__init__.py | DavidHurst/palbolts | 72f9ca3f82499b532f14d0e797426e1b425d3efe | [
"MIT"
] | 2 | 2021-07-15T20:36:25.000Z | 2021-08-04T15:53:50.000Z | conduit/models/self_supervised/moco/__init__.py | DavidHurst/palbolts | 72f9ca3f82499b532f14d0e797426e1b425d3efe | [
"MIT"
] | 18 | 2021-09-07T13:50:10.000Z | 2021-12-06T19:02:23.000Z | conduit/models/self_supervised/moco/__init__.py | predictive-analytics-lab/pal-bolts | 5f1932f351f2e551276b47dfeda7888772d99895 | [
"MIT"
] | 1 | 2021-09-07T14:55:16.000Z | 2021-09-07T14:55:16.000Z | from .lightning import *
from .transforms import *
from .utils import *
| 18 | 25 | 0.75 | from .lightning import *
from .transforms import *
from .utils import *
| true | true |
f7f17c39f3224b585a5a0b6fd2ff405c56c76e68 | 34,266 | py | Python | pgtrigger/core.py | simonw/django-pgtrigger | 588bfcc650e7082f9158582e4b0375ac0b8b9b4b | [
"BSD-3-Clause"
] | null | null | null | pgtrigger/core.py | simonw/django-pgtrigger | 588bfcc650e7082f9158582e4b0375ac0b8b9b4b | [
"BSD-3-Clause"
] | null | null | null | pgtrigger/core.py | simonw/django-pgtrigger | 588bfcc650e7082f9158582e4b0375ac0b8b9b4b | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import copy
import hashlib
import logging
import threading
import django.apps
from django.conf import settings
from django.db import connections
from django.db import DEFAULT_DB_ALIAS
from django.db import models
from django.db import router
from django.db.models.expressions import Col
from django.db... | 31.20765 | 103 | 0.598815 | import contextlib
import copy
import hashlib
import logging
import threading
import django.apps
from django.conf import settings
from django.db import connections
from django.db import DEFAULT_DB_ALIAS
from django.db import models
from django.db import router
from django.db.models.expressions import Col
from django.db... | true | true |
f7f17e0459c8813205636ffc5902aa8568d5ecf5 | 701 | py | Python | strings.py | lucasselani/SummonerWarsPlayer | 9029b03ba47073525fda561771e9bf66530dbe8e | [
"Apache-2.0"
] | null | null | null | strings.py | lucasselani/SummonerWarsPlayer | 9029b03ba47073525fda561771e9bf66530dbe8e | [
"Apache-2.0"
] | null | null | null | strings.py | lucasselani/SummonerWarsPlayer | 9029b03ba47073525fda561771e9bf66530dbe8e | [
"Apache-2.0"
] | null | null | null | energy_empty = 'queryimages\#\energy_empty.png'
get_button = 'queryimages\#\get_button.png'
next_button = 'queryimages\#\\next_button.png'
no_button = 'queryimages\#\\no_button.png'
no_stage_button = 'queryimages\#\\no_stage_button.png'
ok_button = 'queryimages\#\ok_button.png'
replay_button = 'queryimages\#\\replay_bu... | 46.733333 | 78 | 0.774608 | energy_empty = 'queryimages\#\energy_empty.png'
get_button = 'queryimages\#\get_button.png'
next_button = 'queryimages\#\\next_button.png'
no_button = 'queryimages\#\\no_button.png'
no_stage_button = 'queryimages\#\\no_stage_button.png'
ok_button = 'queryimages\#\ok_button.png'
replay_button = 'queryimages\#\\replay_bu... | true | true |
f7f17e5180381b921d2d64dd0396f88cb6622b15 | 1,047 | py | Python | tensorflow/examples/adding_an_op/fact_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 680 | 2016-12-03T14:38:28.000Z | 2022-02-16T04:06:45.000Z | tensorflow/examples/adding_an_op/fact_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 188 | 2016-06-01T08:21:19.000Z | 2022-01-30T07:14:08.000Z | tensorflow/examples/adding_an_op/fact_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 277 | 2016-06-01T07:51:21.000Z | 2022-01-04T12:28:43.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.727273 | 80 | 0.696275 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
class FactTest(tf.test.TestCase):
def test(self):
with self.test_session():
print(tf.user_ops.my_fact().eval())
if __name__ == '__main__':
tf.test.main(... | true | true |
f7f17eb76af9ace214e0fa31466487e147e915cf | 2,820 | py | Python | feature_extraction_template.py | pozhijisi/Feature-Extraction-for-Speech-Recognition | 8c6fa2859e2ef6f91eb39c5b563dd25ffd02089b | [
"Apache-2.0"
] | 2 | 2019-03-05T08:50:14.000Z | 2019-05-24T04:15:19.000Z | feature_extraction_template.py | Peidong-Wang/Feature-Extraction-for-Speech-Recognition | 8c6fa2859e2ef6f91eb39c5b563dd25ffd02089b | [
"Apache-2.0"
] | null | null | null | feature_extraction_template.py | Peidong-Wang/Feature-Extraction-for-Speech-Recognition | 8c6fa2859e2ef6f91eb39c5b563dd25ffd02089b | [
"Apache-2.0"
] | 2 | 2018-11-05T12:47:48.000Z | 2019-05-24T00:37:31.000Z | import tensorflow as tf
import wavefile
import numpy as np
import sys
sys.path.append("./utils")
import fft2melmx
import deltas
import extract_window
# BLOCK: input and output files/folders
# feature extraction arguments
epsilon = 1e-40
num_bins = 80
samp_freq = 16000
low_freq = 20
high_freq = None
window_opts... | 31.333333 | 195 | 0.775177 | import tensorflow as tf
import wavefile
import numpy as np
import sys
sys.path.append("./utils")
import fft2melmx
import deltas
import extract_window
epsilon = 1e-40
num_bins = 80
samp_freq = 16000
low_freq = 20
high_freq = None
window_opts_dict = {}
window_opts_dict['frame_shift_ms'] = 10.0
window_opts_dic... | true | true |
f7f17f82d7661dc922b9c461c7ac06d377922a60 | 1,088 | py | Python | grpc/python/client1.py | kubedge/kubesim_base | 969e143d89326c1f91ae8d8e6fd78382b8fecb53 | [
"Apache-2.0"
] | 1 | 2020-08-25T02:46:03.000Z | 2020-08-25T02:46:03.000Z | grpc/python/client1.py | kubedge/kubesim_base | 969e143d89326c1f91ae8d8e6fd78382b8fecb53 | [
"Apache-2.0"
] | null | null | null | grpc/python/client1.py | kubedge/kubesim_base | 969e143d89326c1f91ae8d8e6fd78382b8fecb53 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Kubedge.
#
# 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, sof... | 29.405405 | 81 | 0.750919 |
from __future__ import print_function
import grpc
import kubedge_pb2
import kubedge_pb2_grpc
def run():
with grpc.insecure_channel('localhost:50051') as channel:
stub = kubedge_pb2_grpc.KubedgeStub(channel)
response = stub.FiveGDemo(kubedge_pb2.EnodeRequest(protocol='X100000... | true | true |
f7f17fa61869f46c5a03ac34a5882fb08b2db946 | 51 | py | Python | torchtext/experimental/__init__.py | mkeshita/text | d4656e2b6fe468a0a925207ab63b754aa03ed3df | [
"BSD-3-Clause"
] | null | null | null | torchtext/experimental/__init__.py | mkeshita/text | d4656e2b6fe468a0a925207ab63b754aa03ed3df | [
"BSD-3-Clause"
] | null | null | null | torchtext/experimental/__init__.py | mkeshita/text | d4656e2b6fe468a0a925207ab63b754aa03ed3df | [
"BSD-3-Clause"
] | null | null | null | from . import transforms
__all__ = ["transforms"]
| 12.75 | 24 | 0.72549 | from . import transforms
__all__ = ["transforms"]
| true | true |
f7f17fad407c3593671d835fe99abeb46cd2e4b9 | 3,215 | py | Python | GAN-version/lib/data_utils.py | Wilder-Wonka/Coloring-greyscale-images | 84e6ac0482fab00201055d5580e64c36c02fc876 | [
"MIT"
] | 453 | 2018-11-20T16:34:55.000Z | 2022-03-31T00:47:03.000Z | GAN-version/lib/data_utils.py | Wilder-Wonka/Coloring-greyscale-images | 84e6ac0482fab00201055d5580e64c36c02fc876 | [
"MIT"
] | 12 | 2019-02-05T22:50:22.000Z | 2022-03-29T15:00:58.000Z | GAN-version/lib/data_utils.py | Wilder-Wonka/Coloring-greyscale-images | 84e6ac0482fab00201055d5580e64c36c02fc876 | [
"MIT"
] | 145 | 2018-11-26T08:53:23.000Z | 2022-03-30T03:06:12.000Z | import numpy as np
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
from keras.preprocessing import image
import tensorflow as tf
from keras.callbacks import TensorBoard
from keras.layers import Input, Dense
from keras.models import Model
import os
from skimage.transform im... | 35.32967 | 100 | 0.690824 | import numpy as np
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
from keras.preprocessing import image
import tensorflow as tf
from keras.callbacks import TensorBoard
from keras.layers import Input, Dense
from keras.models import Model
import os
from skimage.transform im... | true | true |
f7f180435308626def06d4e63816ad7524eddfce | 24,660 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocolstack/vicclientrange_fb32e8ad9c7d9ce20dedea60df43b92a.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocolstack/vicclientrange_fb32e8ad9c7d9ce20dedea60df43b92a.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocolstack/vicclientrange_fb32e8ad9c7d9ce20dedea60df43b92a.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 52.805139 | 2,809 | 0.707015 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class VicClientRange(Base):
__slots__ = ()
_SDM_NAME = 'vicClientRange'
_SDM_ATT_MAP = {
'ChannelIdIncrement': 'channelIdIncrement',
'ChannelIdStart': 'channelIdStart',
'Enabled': ... | true | true |
f7f181c4736b318b2ef9f9640d1885f451e57ecd | 2,272 | py | Python | tests/python/modules/global_report.py | MarkC-b3d/blender-mc3d | b7186feefe7cf6b3fe503e6225fc43dacd97b13f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-06-30T00:39:40.000Z | 2021-06-30T00:39:40.000Z | tests/python/modules/global_report.py | MarkC-b3d/blender-mc3d | b7186feefe7cf6b3fe503e6225fc43dacd97b13f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | tests/python/modules/global_report.py | MarkC-b3d/blender-mc3d | b7186feefe7cf6b3fe503e6225fc43dacd97b13f | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-11-25T04:51:23.000Z | 2020-11-25T04:51:23.000Z | # Apache License, Version 2.0
#
# Generate a HTML page that links to all test reports.
import glob
import os
import pathlib
def _write_html(output_dir):
combined_reports = ""
# Gather intermediate data for all tests and combine into one HTML file.
categories = sorted(glob.glob(os.path.join(output_dir, "... | 29.128205 | 215 | 0.615757 |
import glob
import os
import pathlib
def _write_html(output_dir):
combined_reports = ""
categories = sorted(glob.glob(os.path.join(output_dir, "report", "*")))
for category in categories:
category_name = os.path.basename(category)
combined_reports += "<h3>" + category_name + "</... | true | true |
f7f1839b97d8c4050a3133963c5cba9b66e79e59 | 1,026 | py | Python | detect_secrets/plugins/stripe.py | killuazhu/detect-secrets | 0e8925d685f1fe34a1e315045450cd678104648c | [
"Apache-2.0"
] | 1 | 2020-05-19T05:07:19.000Z | 2020-05-19T05:07:19.000Z | detect_secrets/plugins/stripe.py | killuazhu/detect-secrets | 0e8925d685f1fe34a1e315045450cd678104648c | [
"Apache-2.0"
] | null | null | null | detect_secrets/plugins/stripe.py | killuazhu/detect-secrets | 0e8925d685f1fe34a1e315045450cd678104648c | [
"Apache-2.0"
] | 1 | 2021-07-14T16:53:12.000Z | 2021-07-14T16:53:12.000Z | import re
from base64 import b64encode
import requests
from .base import RegexBasedDetector
from detect_secrets.core.constants import VerifiedResult
class StripeDetector(RegexBasedDetector):
"""Scans for Stripe keys."""
secret_type = 'Stripe Access Key'
denylist = (
# Stripe standard keys begin... | 27.72973 | 77 | 0.61501 | import re
from base64 import b64encode
import requests
from .base import RegexBasedDetector
from detect_secrets.core.constants import VerifiedResult
class StripeDetector(RegexBasedDetector):
secret_type = 'Stripe Access Key'
denylist = (
re.compile(r'(?:r|s)k_live_[0-9a-zA-Z]{24}'),
)
... | true | true |
f7f18402a1160ce856644f4c8082753e0a841873 | 186 | py | Python | python/py-itertools/itertools-product.py | th3c0d3br34ker/hackerrank-solutions | c61e987cbb359fd27e41051c39ffd7f377f0c5f2 | [
"MIT"
] | 1 | 2020-08-04T18:31:24.000Z | 2020-08-04T18:31:24.000Z | python/py-itertools/itertools-product.py | th3c0d3br34ker/hackerrank-solutions | c61e987cbb359fd27e41051c39ffd7f377f0c5f2 | [
"MIT"
] | null | null | null | python/py-itertools/itertools-product.py | th3c0d3br34ker/hackerrank-solutions | c61e987cbb359fd27e41051c39ffd7f377f0c5f2 | [
"MIT"
] | null | null | null | # Enter your code here. Read input from STDIN. Print output to STDOUT
from itertools import product
a = map(int, input().split())
b = map(int, input().split())
print(*product(a, b))
| 18.6 | 69 | 0.688172 |
from itertools import product
a = map(int, input().split())
b = map(int, input().split())
print(*product(a, b))
| true | true |
f7f18440da166c4019bc0f97118b6aabd590a3b5 | 9,186 | py | Python | src/two_heads/ImagePairOverlapFunctionAngleOrientationSequence.py | chienerh/OverlapNet | 5e40476444cb0a950ff21f3343017426c6e6415e | [
"MIT"
] | null | null | null | src/two_heads/ImagePairOverlapFunctionAngleOrientationSequence.py | chienerh/OverlapNet | 5e40476444cb0a950ff21f3343017426c6e6415e | [
"MIT"
] | null | null | null | src/two_heads/ImagePairOverlapFunctionAngleOrientationSequence.py | chienerh/OverlapNet | 5e40476444cb0a950ff21f3343017426c6e6415e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Developed by Xieyuanli Chen and Thomas Läbe
# This file is covered by the LICENSE file in the root of this project.
# Brief: A generator which generates batches for keras training: Special version
import os
import random
import numpy as np
from keras.utils import Sequence
class ImagePairOver... | 42.331797 | 122 | 0.632049 |
import os
import random
import numpy as np
from keras.utils import Sequence
class ImagePairOverlapFunctionAngleOrientationSequence(Sequence):
def __init__(self, image_path, imgfilenames1, imgfilenames2, dir1, dir2, overlap, function_angle, orientation,
network_output_size, batch_size, height,... | true | true |
f7f1854f264884a9705c2d9386d24d905767e5dd | 2,396 | py | Python | src/parser/silk_output_parser.py | ehrhart/STEM | e3865dbd9ab337607e9703b8dca9a9a1099be27d | [
"Apache-2.0"
] | null | null | null | src/parser/silk_output_parser.py | ehrhart/STEM | e3865dbd9ab337607e9703b8dca9a9a1099be27d | [
"Apache-2.0"
] | null | null | null | src/parser/silk_output_parser.py | ehrhart/STEM | e3865dbd9ab337607e9703b8dca9a9a1099be27d | [
"Apache-2.0"
] | null | null | null | import optparse
from collections import defaultdict
import numpy as np
def silk_output_parser(input_file_name,output_file_name,id1,id2):
input_read = open(input_file_name,'rU') #read input file
train = open(output_file_name,'w') #write on output file
#write the headers
train.write(id1)
train.write(',')
... | 31.526316 | 148 | 0.665693 | import optparse
from collections import defaultdict
import numpy as np
def silk_output_parser(input_file_name,output_file_name,id1,id2):
input_read = open(input_file_name,'rU')
train = open(output_file_name,'w')
train.write(id1)
train.write(',')
train.write(id2)
train.write('\n')
k = 0
... | true | true |
f7f1855a4fabc63724225c5ff1d1262392adb09d | 283,955 | py | Python | pandas/core/frame.py | eahogue/pandas | 201ef537dd5003f28c0f56863da9fc817b70392a | [
"BSD-3-Clause"
] | 1 | 2018-12-08T18:14:31.000Z | 2018-12-08T18:14:31.000Z | pandas/core/frame.py | eahogue/pandas | 201ef537dd5003f28c0f56863da9fc817b70392a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/frame.py | eahogue/pandas | 201ef537dd5003f28c0f56863da9fc817b70392a | [
"BSD-3-Clause"
] | null | null | null | # pylint: disable=E1101
# pylint: disable=W0212,W0703,W0622
"""
DataFrame
---------
An efficient 2D container for potentially mixed-type time series or other
labeled data series.
Similar to its R counterpart, data.frame, except providing automatic data
alignment and a host of useful data manipulation methods having to... | 36.691433 | 169 | 0.528482 |
from __future__ import division
import collections
import functools
import itertools
import sys
import warnings
from textwrap import dedent
import numpy as np
import numpy.ma as ma
from pandas._libs import lib, algos as libalgos
from pandas.util._decorators import (Appender, Substitution,
... | true | true |
f7f185911414bd3ce415dc6b6ecf2260822e8e5f | 50 | py | Python | botx/clients/methods/v3/events/__init__.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 13 | 2021-01-21T12:43:10.000Z | 2022-03-23T11:11:59.000Z | botx/clients/methods/v3/events/__init__.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 259 | 2020-02-26T08:51:03.000Z | 2022-03-23T11:08:36.000Z | botx/clients/methods/v3/events/__init__.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 5 | 2019-12-02T16:19:22.000Z | 2021-11-22T20:33:34.000Z | """Definition for methods for events resource."""
| 25 | 49 | 0.74 | true | true | |
f7f18731d198a1013fc56887a317e820a8bb58eb | 105 | py | Python | amt/file_io/__init__.py | bellockk/amtool | 3650697120ac384ac3a0020c84b790ca734df218 | [
"MIT"
] | null | null | null | amt/file_io/__init__.py | bellockk/amtool | 3650697120ac384ac3a0020c84b790ca734df218 | [
"MIT"
] | 2 | 2019-05-30T11:17:51.000Z | 2021-11-15T17:48:34.000Z | amt/file_io/__init__.py | bellockk/amtool | 3650697120ac384ac3a0020c84b790ca734df218 | [
"MIT"
] | null | null | null | __all__ = []
from . import file_io as _mod
from .file_io import *
__all__.extend(_mod.__all__)
del(_mod)
| 17.5 | 29 | 0.742857 | __all__ = []
from . import file_io as _mod
from .file_io import *
__all__.extend(_mod.__all__)
del(_mod)
| true | true |
f7f18805e49ab5e71d67938a8ffec9e3778af8ec | 3,558 | py | Python | scripts-dev/mypy_synapse_plugin.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | null | null | null | scripts-dev/mypy_synapse_plugin.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | null | null | null | scripts-dev/mypy_synapse_plugin.py | littlebenlittle/synapse | 0eccf531466d762ede0dd365284a8465bfb18d0f | [
"Apache-2.0"
] | 1 | 2021-09-27T14:45:52.000Z | 2021-09-27T14:45:52.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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 require... | 34.211538 | 79 | 0.70208 |
from typing import Callable, Optional
from mypy.nodes import ARG_NAMED_OPT
from mypy.plugin import MethodSigContext, Plugin
from mypy.typeops import bind_self
from mypy.types import CallableType, NoneType
class SynapsePlugin(Plugin):
def get_method_signature_hook(
self, fullname: str
... | true | true |
f7f18a1af0bc1cd0da20f84f44d77300c323b217 | 907 | py | Python | vgg16/test_vgg16/test_vgg16.py | Rumiachang/keras-examples | 467ac2e693930980bb21315fb33b298fff852a31 | [
"MIT"
] | 81 | 2017-04-15T15:15:49.000Z | 2021-11-15T12:34:17.000Z | vgg16/test_vgg16/test_vgg16.py | Rumiachang/keras-examples | 467ac2e693930980bb21315fb33b298fff852a31 | [
"MIT"
] | 43 | 2016-11-25T06:15:51.000Z | 2017-03-28T11:25:30.000Z | vgg16/test_vgg16/test_vgg16.py | Rumiachang/keras-examples | 467ac2e693930980bb21315fb33b298fff852a31 | [
"MIT"
] | 56 | 2017-04-22T13:33:59.000Z | 2021-06-14T04:18:23.000Z | from keras.applications.vgg16 import VGG16, preprocess_input, decode_predictions
from keras.preprocessing import image
import numpy as np
import sys
"""
ImageNetで学習済みのVGG16モデルを使って入力画像のクラスを予測する
"""
if len(sys.argv) != 2:
print("usage: python test_vgg16.py [image file]")
sys.exit(1)
filename = sys.argv[1]
# 学... | 23.25641 | 80 | 0.76957 | from keras.applications.vgg16 import VGG16, preprocess_input, decode_predictions
from keras.preprocessing import image
import numpy as np
import sys
if len(sys.argv) != 2:
print("usage: python test_vgg16.py [image file]")
sys.exit(1)
filename = sys.argv[1]
model = VGG16(weights='imagenet')
img = image... | true | true |
f7f18a1e2b79daa8cf9ff553fbd3468b80ad87fe | 12,068 | py | Python | 3rdParty/waf/waflib/Tools/tex.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | null | null | null | 3rdParty/waf/waflib/Tools/tex.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | null | null | null | 3rdParty/waf/waflib/Tools/tex.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
"""
TeX/LaTeX/PDFLaTeX/XeLaTeX support
Example::
def configure(conf):
conf.load('tex')
if not conf.env.LATEX:
conf.fatal('The program LaTex is required')
def build(bld):
bld(
features = 'tex',
type = 'latex', # pdflatex or x... | 28.801909 | 154 | 0.66175 |
import os, re
from waflib import Utils, Task, Errors, Logs
from waflib.TaskGen import feature, before_method
re_bibunit = re.compile(r'\\(?P<type>putbib)\[(?P<file>[^\[\]]*)\]',re.M)
def bibunitscan(self):
node = self.inputs[0]
nodes = []
if not node: return nodes
code = node.read()
for match in re_bibuni... | true | true |
f7f18a826f7528e7e6e39a402e8feab383d4dbe2 | 7,329 | py | Python | src/tools/protoc_wrapper/protoc_wrapper.py | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | null | null | null | src/tools/protoc_wrapper/protoc_wrapper.py | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | null | null | null | src/tools/protoc_wrapper/protoc_wrapper.py | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A simple wrapper for protoc.
Script for //third_party/protobuf/proto_library.gni .
Features:
- Inserts #include for extra heade... | 34.408451 | 80 | 0.66694 |
from __future__ import print_function
import argparse
import os.path
import subprocess
import sys
import tempfile
PROTOC_INCLUDE_POINT = "// @@protoc_insertion_point(includes)"
def FormatGeneratorOptions(options):
if not options:
return ""
if options.endswith(":"):
return options
return options +... | true | true |
f7f18ae6e4e5cb749b3095a8ddf182807e88158b | 6,453 | py | Python | tests/test_common.py | maxfrei750/fvcore | 4ede864f410e204ce1b40284852aa238a85f2e64 | [
"Apache-2.0"
] | null | null | null | tests/test_common.py | maxfrei750/fvcore | 4ede864f410e204ce1b40284852aa238a85f2e64 | [
"Apache-2.0"
] | null | null | null | tests/test_common.py | maxfrei750/fvcore | 4ede864f410e204ce1b40284852aa238a85f2e64 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import numpy as np
import time
import unittest
from fvcore.common.config import CfgNode
from fvcore.common.history_buffer import HistoryBuffer
from fvcore.common.registry import Registry
from fvcore.common.timer import Time... | 31.024038 | 84 | 0.588408 |
import numpy as np
import time
import unittest
from fvcore.common.config import CfgNode
from fvcore.common.history_buffer import HistoryBuffer
from fvcore.common.registry import Registry
from fvcore.common.timer import Timer
class TestHistoryBuffer(unittest.TestCase):
def setUp(self) -> None:
super().... | true | true |
f7f18b4a2ccd57a3df27a945b49300ee0e4936a3 | 1,079 | py | Python | Library_Management/library_management/library_management/urls.py | pankesh18/web_dev_for_info_system | e46faf4113e219eb3caad5fa494f2c5506df2689 | [
"Unlicense"
] | null | null | null | Library_Management/library_management/library_management/urls.py | pankesh18/web_dev_for_info_system | e46faf4113e219eb3caad5fa494f2c5506df2689 | [
"Unlicense"
] | null | null | null | Library_Management/library_management/library_management/urls.py | pankesh18/web_dev_for_info_system | e46faf4113e219eb3caad5fa494f2c5506df2689 | [
"Unlicense"
] | null | null | null | """library_management URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 38.535714 | 77 | 0.71177 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('manage_user.urls')),
path('admin/', admin.site.urls),
path('lib/', include('Library.urls')),
path('api/',include('api.urls... | true | true |
f7f18b530ac50008dd9ec04e0d803d60769a89a0 | 31,103 | py | Python | pysnmp/HH3C-LswINF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/HH3C-LswINF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/HH3C-LswINF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module HH3C-LswINF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-LswINF-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:13:00 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | 123.916335 | 5,151 | 0.773687 |
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint = mibBuild... | true | true |
f7f18cf6bd3c530e39f1cf2ca538656f438a7765 | 1,166 | py | Python | testing/test_cases/object_formatting_test_cases.py | python-discord/flake8-annotations | f96dd508d5b2c0bcaf3019d6dcfe65612e6cef78 | [
"MIT"
] | 49 | 2019-08-06T20:54:38.000Z | 2020-09-02T10:59:24.000Z | testing/test_cases/object_formatting_test_cases.py | python-discord/flake8-annotations | f96dd508d5b2c0bcaf3019d6dcfe65612e6cef78 | [
"MIT"
] | 73 | 2019-08-06T18:02:54.000Z | 2020-08-31T12:21:39.000Z | testing/test_cases/object_formatting_test_cases.py | python-discord/flake8-annotations | f96dd508d5b2c0bcaf3019d6dcfe65612e6cef78 | [
"MIT"
] | 12 | 2019-08-08T20:25:59.000Z | 2020-09-02T18:17:48.000Z | from functools import partial
from typing import NamedTuple, Union
from flake8_annotations.ast_walker import Argument, Function
from flake8_annotations.enums import AnnotationType
class FormatTestCase(NamedTuple):
"""Named tuple for representing our test cases."""
test_object: Union[Argument, Function]
... | 35.333333 | 124 | 0.714408 | from functools import partial
from typing import NamedTuple, Union
from flake8_annotations.ast_walker import Argument, Function
from flake8_annotations.enums import AnnotationType
class FormatTestCase(NamedTuple):
test_object: Union[Argument, Function]
str_output: str
arg = partial(Argument, lineno=0, co... | true | true |
f7f18cf7d1aed5e2e6d6df26660d14dce4345794 | 550 | py | Python | 801-900/820.trie-short-encoding-of-words.py | guangxu-li/leetcode-in-python | 8a5a373b32351500342705c141591a1a8f5f1cb1 | [
"MIT"
] | null | null | null | 801-900/820.trie-short-encoding-of-words.py | guangxu-li/leetcode-in-python | 8a5a373b32351500342705c141591a1a8f5f1cb1 | [
"MIT"
] | null | null | null | 801-900/820.trie-short-encoding-of-words.py | guangxu-li/leetcode-in-python | 8a5a373b32351500342705c141591a1a8f5f1cb1 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=820 lang=python3
#
# [820] Short Encoding of Words
#
# @lc code=start
from collections import defaultdict
from functools import reduce
class Solution:
def minimumLengthEncoding(self, words: List[str]) -> int:
words = list(set(words))
Trie = lambda: defaultdict(Trie)
... | 22 | 85 | 0.629091 |
from collections import defaultdict
from functools import reduce
class Solution:
def minimumLengthEncoding(self, words: List[str]) -> int:
words = list(set(words))
Trie = lambda: defaultdict(Trie)
trie = Trie()
nodes = [
reduce(lambda node, ch: node[ch], reversed... | true | true |
f7f18e70183fb54e39b8e2d139002956067d358c | 2,866 | py | Python | app-test.py | ikakurniawati084/flaskr-tdd | 5a9d95cd64422450f949f4d3bb785054e7ba260f | [
"MIT"
] | 3 | 2019-07-29T16:14:01.000Z | 2021-02-15T01:29:59.000Z | app-test.py | ikakurniawati084/flaskr-tdd | 5a9d95cd64422450f949f4d3bb785054e7ba260f | [
"MIT"
] | 5 | 2017-05-11T16:29:07.000Z | 2019-06-22T11:46:25.000Z | app-test.py | ikakurniawati084/flaskr-tdd | 5a9d95cd64422450f949f4d3bb785054e7ba260f | [
"MIT"
] | 156 | 2019-07-22T00:36:37.000Z | 2020-12-16T11:55:59.000Z | import unittest
import os
import json
from app import app, db
TEST_DB = 'test.db'
class BasicTestCase(unittest.TestCase):
def test_index(self):
"""initial test. ensure flask was set up correctly"""
tester = app.test_client(self)
response = tester.get('/', content_type='html/text')
... | 32.568182 | 77 | 0.613398 | import unittest
import os
import json
from app import app, db
TEST_DB = 'test.db'
class BasicTestCase(unittest.TestCase):
def test_index(self):
tester = app.test_client(self)
response = tester.get('/', content_type='html/text')
self.assertEqual(response.status_code, 200)
def test_d... | true | true |
f7f18ec7cee3d77fa1018bbe49fa7b3ac98248f7 | 798 | py | Python | 18Host/TDT4110/PythonWorkspace/Oving7/Sorting.py | MarcusTL12/School | f7302f2d390e99ad9d06004e15da032c05ec59e7 | [
"Apache-2.0"
] | null | null | null | 18Host/TDT4110/PythonWorkspace/Oving7/Sorting.py | MarcusTL12/School | f7302f2d390e99ad9d06004e15da032c05ec59e7 | [
"Apache-2.0"
] | null | null | null | 18Host/TDT4110/PythonWorkspace/Oving7/Sorting.py | MarcusTL12/School | f7302f2d390e99ad9d06004e15da032c05ec59e7 | [
"Apache-2.0"
] | null | null | null |
def bubblesort(l):
for i in range(len(l) - 1):
for j in range(len(l) - i - 1):
if l[j] > l[j + 1]:
l[j], l[j + 1] = l[j + 1], l[j]
def selectionsort(l):
for i in range(len(l)):
minst = i
for j in range(i, len(l)):
if l[minst] > l[j]:
minst = j
l[minst], l[i] = l[i], l[minst]
def a():
... | 22.8 | 102 | 0.625313 |
def bubblesort(l):
for i in range(len(l) - 1):
for j in range(len(l) - i - 1):
if l[j] > l[j + 1]:
l[j], l[j + 1] = l[j + 1], l[j]
def selectionsort(l):
for i in range(len(l)):
minst = i
for j in range(i, len(l)):
if l[minst] > l[j]:
minst = j
l[minst], l[i] = l[i], l[minst]
def a():
... | true | true |
f7f18f8f162a60f2f9d58b6a6603ce3b42976fb9 | 2,672 | py | Python | example/main.py | TimmyTango/hackathon2018 | 920ed55c083b77f22835611edada583999ca58bd | [
"MIT"
] | null | null | null | example/main.py | TimmyTango/hackathon2018 | 920ed55c083b77f22835611edada583999ca58bd | [
"MIT"
] | null | null | null | example/main.py | TimmyTango/hackathon2018 | 920ed55c083b77f22835611edada583999ca58bd | [
"MIT"
] | null | null | null | import cbthelper as cbt
from selenium import webdriver
import sys, os
def main():
# set username and auth key for api requests
username = os.environ['CBT_USERNAME'] or ''
authkey = os.environ['CBT_AUTHKEY'] or ''
if username == '' or authkey == '':
print("Don't forget to set username and authke... | 33.4 | 86 | 0.680763 | import cbthelper as cbt
from selenium import webdriver
import sys, os
def main():
username = os.environ['CBT_USERNAME'] or ''
authkey = os.environ['CBT_AUTHKEY'] or ''
if username == '' or authkey == '':
print("Don't forget to set username and authkey in main.py")
sys.exit(1)
cbt.l... | true | true |
f7f190e6913b85f80fb47b5ba84165c485b0c324 | 4,619 | py | Python | mhs/common/mhs_common/workflow/__init__.py | tomzo/integration-adaptors | d4f296d3e44475df6f69a78a27fac6ed5b67513b | [
"Apache-2.0"
] | null | null | null | mhs/common/mhs_common/workflow/__init__.py | tomzo/integration-adaptors | d4f296d3e44475df6f69a78a27fac6ed5b67513b | [
"Apache-2.0"
] | 4 | 2021-03-31T19:46:30.000Z | 2021-03-31T19:55:03.000Z | mhs/common/mhs_common/workflow/__init__.py | tomzo/integration-adaptors | d4f296d3e44475df6f69a78a27fac6ed5b67513b | [
"Apache-2.0"
] | 2 | 2020-04-02T11:22:17.000Z | 2021-04-11T07:24:48.000Z | """Modules related to management of the workflow for supported messaging patterns."""
from typing import Dict
from comms import queue_adaptor
from mhs_common.routing import routing_reliability
from mhs_common.state import persistence_adaptor
from mhs_common.transmission import transmission_adaptor
from mhs_common.wor... | 59.987013 | 122 | 0.599264 | from typing import Dict
from comms import queue_adaptor
from mhs_common.routing import routing_reliability
from mhs_common.state import persistence_adaptor
from mhs_common.transmission import transmission_adaptor
from mhs_common.workflow.asynchronous_express import AsynchronousExpressWorkflow
from mhs_common.workflow... | true | true |
f7f1917b87d917888585f70cf93a5794021c410a | 985 | py | Python | src/euler_python_package/euler_python/easiest/p019.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/easiest/p019.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/easiest/p019.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | import datetime
# We simply use Python's built-in date library to compute the answer by brute force.
def problem019():
"""
You are given the following information, but you may prefer to do some
research for yourself.
• 1 Jan 1900 was a Monday.
• Thirty days has September,
... | 28.142857 | 84 | 0.605076 | import datetime
def problem019():
ans = sum(
1
for y in range(1901, 2001)
for m in range(1, 13)
if datetime.date(y, m, 1).weekday() == 6
)
return ans
if __name__ == "__main__":
print(problem019())
| true | true |
f7f1924daf70437ce17a8e732d339f815e7edf78 | 940 | py | Python | ms2ldaviz/ms2ldaviz/views.py | sdrogers/ms2ldaviz | ba311bc80891da595d2d6cef4abda95ab583c201 | [
"MIT"
] | 6 | 2017-10-27T02:37:55.000Z | 2020-11-07T15:43:57.000Z | ms2ldaviz/ms2ldaviz/views.py | sdrogers/ms2ldaviz | ba311bc80891da595d2d6cef4abda95ab583c201 | [
"MIT"
] | 134 | 2016-07-20T08:35:34.000Z | 2020-07-22T13:51:49.000Z | ms2ldaviz/ms2ldaviz/views.py | sdrogers/ms2ldaviz | ba311bc80891da595d2d6cef4abda95ab583c201 | [
"MIT"
] | 9 | 2016-07-19T15:39:27.000Z | 2020-02-11T16:13:14.000Z | from django.shortcuts import render
from django.template.loader import render_to_string
def home(request):
context_dict = {}
return render(request,'ms2ldaviz/index.html',context_dict)
def people(request):
context_dict = {}
return render(request,'ms2ldaviz/people.html',context_dict)
def about(reque... | 29.375 | 86 | 0.756383 | from django.shortcuts import render
from django.template.loader import render_to_string
def home(request):
context_dict = {}
return render(request,'ms2ldaviz/index.html',context_dict)
def people(request):
context_dict = {}
return render(request,'ms2ldaviz/people.html',context_dict)
def about(reque... | true | true |
f7f1926183183ef6c5b329b000b6661c7ca0a8a1 | 2,218 | py | Python | alipay/aop/api/response/AlipayMarketingActivityShopBatchqueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayMarketingActivityShopBatchqueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayMarketingActivityShopBatchqueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.ActivityShopInfo import ActivityShopInfo
class AlipayMarketingActivityShopBatchqueryResponse(AlipayResponse):
def __init__(self):
super(AlipayMarketingAc... | 30.383562 | 118 | 0.651939 |
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.ActivityShopInfo import ActivityShopInfo
class AlipayMarketingActivityShopBatchqueryResponse(AlipayResponse):
def __init__(self):
super(AlipayMarketingActivityShopBatchqueryResponse, self).__init__... | true | true |
f7f192b216dd038ad817e7a178648e7c09c0870c | 55,211 | py | Python | bzt/modules/apiritif/generator.py | nickgashkov/taurus | 4a4d9566336deef1b384f70daaf2b070af455857 | [
"Apache-2.0"
] | 1 | 2019-12-05T14:57:58.000Z | 2019-12-05T14:57:58.000Z | bzt/modules/apiritif/generator.py | nickgashkov/taurus | 4a4d9566336deef1b384f70daaf2b070af455857 | [
"Apache-2.0"
] | null | null | null | bzt/modules/apiritif/generator.py | nickgashkov/taurus | 4a4d9566336deef1b384f70daaf2b070af455857 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 BlazeMeter 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 writing, software... | 40.656112 | 119 | 0.541215 |
import ast
import math
import re
import string
from collections import OrderedDict
import astunparse
from bzt import TaurusConfigError, TaurusInternalException
from bzt.engine import Scenario
from bzt.requests_model import HTTPRequest, HierarchicRequestParser, TransactionBlock, \
SetVariables, IncludeScenarioBlo... | true | true |
f7f19350a41f48a80e38a6b3bdc3f35df5b658e3 | 5,801 | py | Python | gold_digger/data_providers/currency_layer.py | roihunter/gold-digger | 40051f99b64b6bb5d7d7fe209ebb0483b973716c | [
"Apache-2.0"
] | null | null | null | gold_digger/data_providers/currency_layer.py | roihunter/gold-digger | 40051f99b64b6bb5d7d7fe209ebb0483b973716c | [
"Apache-2.0"
] | 94 | 2019-07-03T15:33:29.000Z | 2022-03-28T01:17:41.000Z | gold_digger/data_providers/currency_layer.py | roihunter/gold-digger | 40051f99b64b6bb5d7d7fe209ebb0483b973716c | [
"Apache-2.0"
] | 1 | 2022-01-14T11:24:36.000Z | 2022-01-14T11:24:36.000Z | import re
from collections import defaultdict
from datetime import date, timedelta
from operator import attrgetter
from cachetools import cachedmethod, keys
from ._provider import Provider
class CurrencyLayer(Provider):
"""
Real-time service with free plan for 250 requests per month.
Implicit base curre... | 39.195946 | 142 | 0.607826 | import re
from collections import defaultdict
from datetime import date, timedelta
from operator import attrgetter
from cachetools import cachedmethod, keys
from ._provider import Provider
class CurrencyLayer(Provider):
BASE_URL = "http://www.apilayer.net/api/live?access_key=%s"
name = "currency_layer"
... | true | true |
f7f193cbdba4ae37817762c22d448e0b997d1927 | 27,183 | py | Python | src/storage-preview/azext_storage_preview/vendored_sdks/azure_storage/v2018_03_28/blob/models.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 3 | 2019-02-21T20:46:26.000Z | 2021-06-22T15:35:52.000Z | src/storage-preview/azext_storage_preview/vendored_sdks/azure_storage/v2018_03_28/blob/models.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 11 | 2017-10-05T18:20:40.000Z | 2020-10-10T09:20:19.000Z | src/storage-preview/azext_storage_preview/vendored_sdks/azure_storage/v2018_03_28/blob/models.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 15 | 2017-10-02T18:48:20.000Z | 2022-03-03T14:03:49.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from ..com... | 35.533333 | 149 | 0.656109 |
from ..common._common_conversion import _to_str
class Container(object):
def __init__(self, name=None, props=None, metadata=None):
self.name = name
self.properties = props or ContainerProperties()
self.metadata = metadata
class ContainerProperties(object):
def __init__(self):
... | true | true |
f7f193d6cc6aecd79c9333725d69cc62b6a0a38b | 1,419 | py | Python | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/BatchGetDeviceStateRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/BatchGetDeviceStateRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/BatchGetDeviceStateRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.342105 | 72 | 0.756871 |
from aliyunsdkcore.request import RpcRequest
class BatchGetDeviceStateRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'BatchGetDeviceState')
def get_DeviceNames(self):
return self.get_query_params().get('DeviceNames')
def set_DeviceNames(self,Dev... | true | true |
f7f1946cd50419409d75c331554949c73267c896 | 1,172 | py | Python | pyctr/util.py | Desterly/pyctr | 710e96217b64dd4bac302d94261e73b8b1fd3b89 | [
"MIT"
] | 18 | 2020-07-10T19:07:10.000Z | 2022-03-24T06:09:14.000Z | pyctr/util.py | Desterly/pyctr | 710e96217b64dd4bac302d94261e73b8b1fd3b89 | [
"MIT"
] | 20 | 2020-07-10T13:13:30.000Z | 2022-02-19T21:04:23.000Z | pyctr/util.py | Desterly/pyctr | 710e96217b64dd4bac302d94261e73b8b1fd3b89 | [
"MIT"
] | 7 | 2021-02-18T08:41:53.000Z | 2022-03-24T06:09:20.000Z | # This file is a part of pyctr.
#
# Copyright (c) 2017-2021 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE in the root of this project.
import os
from math import ceil
from sys import platform
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from... | 27.904762 | 87 | 0.682594 |
import os
from math import ceil
from sys import platform
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import List
__all__ = ['windows', 'macos', 'readle', 'readbe', 'roundup', 'config_dirs']
windows = platform == 'win32'
macos = platform == 'darwin'
def readle(b: bytes) -> int:
retu... | true | true |
f7f195befb60014e56e7f8b0a7ed569158c8985c | 21,874 | py | Python | synth/devices/vending_machine.py | pervasivesolutions/synth | 7b00f14dffc2630acd2743d0d5cf9f7c1627b067 | [
"MIT"
] | 2 | 2021-03-15T18:02:46.000Z | 2021-12-09T20:54:25.000Z | synth/devices/vending_machine.py | pervasivesolutions/synth | 7b00f14dffc2630acd2743d0d5cf9f7c1627b067 | [
"MIT"
] | 2 | 2017-04-18T08:41:49.000Z | 2017-10-04T15:13:06.000Z | synth/devices/vending_machine.py | pervasivesolutions/synth | 7b00f14dffc2630acd2743d0d5cf9f7c1627b067 | [
"MIT"
] | 3 | 2018-02-06T17:07:06.000Z | 2020-01-27T17:05:11.000Z | """
vending_machine
=====
Simulates a vending machine.
Configurable parameters::
{
"product_catalogue" : (optional) [ "name" : "Mars Bar", "price" : 0.80, "category" : "snack", "lifetime" : "P1000D", ... ]
"send_available_positions" : (optional) False
"cashless_to_cash_ratio" :... | 48.074725 | 315 | 0.612097 |
from .device import Device
import random
import isodate
import logging
HOURS = 60*60
DAYS = HOURS*24
HEARTBEAT_INTERVAL = 1 * DAYS
MAX_STOCK_PER_POSITION = 10
MAX_VENDING_INTERVAL_S = 6 * HOURS
MIN_REPLENISH_INTERVAL_S = 1 * DAYS
MAX_REPLENISH_INTERVAL_S = 14 * DAYS
EXPIRY_CHECK_INTERVAL = 1 * HOURS
ALERT_CHE... | true | true |
f7f197208c80f53359377a089b7a82a114290577 | 818 | py | Python | lambdata_jayadamo/dataframe_helper.py | Malven2019/lambdata-1 | 1857a2204de6c94cba31a72fe5513d1c85227d38 | [
"MIT"
] | null | null | null | lambdata_jayadamo/dataframe_helper.py | Malven2019/lambdata-1 | 1857a2204de6c94cba31a72fe5513d1c85227d38 | [
"MIT"
] | null | null | null | lambdata_jayadamo/dataframe_helper.py | Malven2019/lambdata-1 | 1857a2204de6c94cba31a72fe5513d1c85227d38 | [
"MIT"
] | 1 | 2020-08-05T01:58:58.000Z | 2020-08-05T01:58:58.000Z | #!/usr/bin/env python
"""
Some functions to help cleaning and handling dataframes.
"""
# import libraries
import pandas as pd
import random
'''
1) A function to find missing values in a dataframe
'''
# defining report_missing_values
def report_missing_values(df):
report_missing_values = pd.isnull
... | 18.590909 | 65 | 0.696822 |
import pandas as pd
import random
def report_missing_values(df):
report_missing_values = pd.isnull
print(f'Here are the missing values:', report_missing_values)
num1 = input('Enter first number: ')
num2 = input('Enter second number: ')
sum = float(num1) + float(num2)
print('The sum o... | true | true |
f7f197497b756fdd02d0a4a863008fe8a1b58b67 | 2,593 | py | Python | move.py | sasa-buklijas/crypto-move | 772b706eaa05788e175988e16e6e47a3bd3471f4 | [
"MIT"
] | null | null | null | move.py | sasa-buklijas/crypto-move | 772b706eaa05788e175988e16e6e47a3bd3471f4 | [
"MIT"
] | null | null | null | move.py | sasa-buklijas/crypto-move | 772b706eaa05788e175988e16e6e47a3bd3471f4 | [
"MIT"
] | null | null | null | import streamlit as st
import requests
st.title('Input Move')
st.write('Test input on output price.')
st.write('Currently only for Binance.')
st.write('By: [buklijas.info](http://buklijas.info)')
@st.cache
def get_pairs():
EI_URL = 'https://api.binance.com/api/v3/exchangeInfo'
r = requests.get(EI_URL)
if... | 32.012346 | 115 | 0.585808 | import streamlit as st
import requests
st.title('Input Move')
st.write('Test input on output price.')
st.write('Currently only for Binance.')
st.write('By: [buklijas.info](http://buklijas.info)')
@st.cache
def get_pairs():
EI_URL = 'https://api.binance.com/api/v3/exchangeInfo'
r = requests.get(EI_URL)
if... | true | true |
f7f198075735ed309cc9d38b783a03410d6ea880 | 11,879 | py | Python | sdk/python/pulumi_aws/lex/slot_type.py | mehd-io/pulumi-aws | 034629c3fb30dc90db65b196d115df43723df19c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lex/slot_type.py | mehd-io/pulumi-aws | 034629c3fb30dc90db65b196d115df43723df19c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lex/slot_type.py | mehd-io/pulumi-aws | 034629c3fb30dc90db65b196d115df43723df19c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | 47.899194 | 185 | 0.648455 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = ['SlotType']
class SlotType(pulumi.CustomResource):
def __init__(__self__,
resource_name: s... | true | true |
f7f1982273322247583bfd5805c408640c1137b1 | 8,670 | py | Python | addons/io_scene_gltf2/blender/imp/gltf2_blender_primitive.py | Cyp/glTF-Blender-IO | 232018e779469912e68ae876a9e02ad4cd258b5b | [
"Apache-2.0"
] | null | null | null | addons/io_scene_gltf2/blender/imp/gltf2_blender_primitive.py | Cyp/glTF-Blender-IO | 232018e779469912e68ae876a9e02ad4cd258b5b | [
"Apache-2.0"
] | null | null | null | addons/io_scene_gltf2/blender/imp/gltf2_blender_primitive.py | Cyp/glTF-Blender-IO | 232018e779469912e68ae876a9e02ad4cd258b5b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The glTF-Blender-IO authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 49.261364 | 117 | 0.591926 |
import bpy
from mathutils import Vector
from .gltf2_blender_material import BlenderMaterial
from ..com.gltf2_blender_conversion import loc_gltf_to_blender
from ...io.imp.gltf2_io_binary import BinaryData
class BlenderPrimitive():
def __new__(cls, *args, **kwargs):
raise RuntimeError("%s sho... | true | true |
f7f1985047b8cce3f3dccfda6bc18b735a61821e | 43,173 | py | Python | src/python/datastore/data_types.py | Google-Autofuzz/clusterfuzz | ba5086c9852a1ad2425126fa7a95c02213ddbab4 | [
"Apache-2.0"
] | 3 | 2020-12-30T07:00:55.000Z | 2021-03-16T10:55:05.000Z | src/python/datastore/data_types.py | Google-Autofuzz/clusterfuzz | ba5086c9852a1ad2425126fa7a95c02213ddbab4 | [
"Apache-2.0"
] | null | null | null | src/python/datastore/data_types.py | Google-Autofuzz/clusterfuzz | ba5086c9852a1ad2425126fa7a95c02213ddbab4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.550308 | 80 | 0.732657 |
from builtins import next
from builtins import object
import re
import six
from future import utils as future_utils
from google.cloud import ndb
from base import json_utils
from base import utils
from datastore import search_tokenizer
from metrics import logs
from system import environment
BLOBSTO... | true | true |
f7f199a6af9f5325f02451a70e6c268b8d90f2f1 | 778 | py | Python | Module_06/src/elements/cart_item.py | JoseGtz/2021_python_selenium | c7b39479c78839ba2e2e2633a0f673a8b02fb4cb | [
"Unlicense"
] | null | null | null | Module_06/src/elements/cart_item.py | JoseGtz/2021_python_selenium | c7b39479c78839ba2e2e2633a0f673a8b02fb4cb | [
"Unlicense"
] | null | null | null | Module_06/src/elements/cart_item.py | JoseGtz/2021_python_selenium | c7b39479c78839ba2e2e2633a0f673a8b02fb4cb | [
"Unlicense"
] | null | null | null | from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.wait import WebDriverWait
from Module_06.src.elements.base_page_element import BasePageElement
from Module_06.src.locators.cart_items import CartItemLoc
from Module_06.src.mixin.InventoryItemMixin import InventoryItemMixin
cla... | 55.571429 | 90 | 0.79563 | from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.wait import WebDriverWait
from Module_06.src.elements.base_page_element import BasePageElement
from Module_06.src.locators.cart_items import CartItemLoc
from Module_06.src.mixin.InventoryItemMixin import InventoryItemMixin
cla... | true | true |
f7f19a1f856b61c4d062a5ab6c9ccfd402a68d39 | 2,055 | py | Python | test/record/parser/test_response_whois_nic_sm_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null | test/record/parser/test_response_whois_nic_sm_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null | test/record/parser/test_response_whois_nic_sm_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/whois.nic.sm/status_registered
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parser import parse ... | 37.363636 | 87 | 0.693917 |
from nose.tools import *
from dateutil.parser import parse as time_parse
import yawhois
class TestWhoisNicSmStatusRegistered(object):
def setUp(self):
fixture_path = "spec/fixtures/responses/whois.nic.sm/status_registered.txt"
host = "whois.nic.sm"
part = yawhois... | true | true |
f7f19a2795fa29ea405bd933ffb0e8e61cca7d6e | 8,114 | py | Python | build/lib.macosx-10.9-x86_64-3.9/mediapipe/calculators/util/detections_to_rects_calculator_pb2.py | hanggaoh/mediapipe | 9eafb85cd7daa8986be7e4cc8af2f256f6f83451 | [
"Apache-2.0"
] | 2 | 2021-08-11T15:50:12.000Z | 2021-09-03T17:53:47.000Z | build/lib.macosx-10.9-x86_64-3.9/mediapipe/calculators/util/detections_to_rects_calculator_pb2.py | hanggaoh/mediapipe | 9eafb85cd7daa8986be7e4cc8af2f256f6f83451 | [
"Apache-2.0"
] | 1 | 2022-01-20T11:17:50.000Z | 2022-01-20T11:17:50.000Z | build/lib.macosx-10.9-x86_64-3.9/mediapipe/calculators/util/detections_to_rects_calculator_pb2.py | hanggaoh/mediapipe | 9eafb85cd7daa8986be7e4cc8af2f256f6f83451 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/calculators/util/detections_to_rects_calculator.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf im... | 52.688312 | 874 | 0.811314 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from mediapipe.framework import calculator_pb2 as mediap... | true | true |
f7f19b47469a857935771c848ddb0b38c7e862c0 | 1,186 | py | Python | trypython/basic/others/mathoperators01.py | devlights/try-python | 67d1d26476794da81c8c76662486108ce03f8fb4 | [
"MIT"
] | 4 | 2019-10-21T11:42:11.000Z | 2020-03-12T16:35:51.000Z | trypython/basic/others/mathoperators01.py | devlights/try-python | 67d1d26476794da81c8c76662486108ce03f8fb4 | [
"MIT"
] | 80 | 2017-02-08T07:55:37.000Z | 2021-10-06T06:30:30.000Z | trypython/basic/others/mathoperators01.py | devlights/try-python | 67d1d26476794da81c8c76662486108ce03f8fb4 | [
"MIT"
] | 1 | 2020-03-12T04:37:17.000Z | 2020-03-12T04:37:17.000Z | # coding: utf-8
"""
Pythonの数学演算子についてのサンプルです。
"""
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
class Sample(SampleBase):
def exec(self):
# ---------------------------------------
# 加算
# ---------------------------------------
pr('add',... | 24.204082 | 49 | 0.232715 |
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
class Sample(SampleBase):
def exec(self):
pr('add', 2 + 3)
pr('sub', 5 - 3)
pr('mul', 2 * 3)
... | true | true |
f7f19c9228d6f254ebbf3f215d30f339e487576f | 3,073 | py | Python | cli/tests/pcluster/config/test_section_aws.py | mkosmo/cfncluster | f1817cc187f2b92127d48f16debb4b7ea4f4a80f | [
"Apache-2.0"
] | 2 | 2018-12-14T18:03:01.000Z | 2019-03-07T19:39:26.000Z | cli/tests/pcluster/config/test_section_aws.py | mkosmo/cfncluster | f1817cc187f2b92127d48f16debb4b7ea4f4a80f | [
"Apache-2.0"
] | null | null | null | cli/tests/pcluster/config/test_section_aws.py | mkosmo/cfncluster | f1817cc187f2b92127d48f16debb4b7ea4f4a80f | [
"Apache-2.0"
] | 1 | 2019-05-10T16:03:19.000Z | 2019-05-10T16:03:19.000Z | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 43.9 | 119 | 0.671331 |
import pytest
import tests.pcluster.config.utils as utils
from pcluster.config.mappings import AWS
@pytest.mark.parametrize(
"config_parser_dict, expected_dict_params, expected_message",
[
({"aws": {}}, {}, None),
(
{"aws": {"aws_access_key_id": "test",... | true | true |
f7f19d766dc7301c9ea99421f778edc35f2e294e | 1,822 | py | Python | src/my_package/data_cleanup.py | ShiNik/marathon_machine_learning | 102041c9ccdf630e33cbcc19eadcde4151564228 | [
"MIT"
] | null | null | null | src/my_package/data_cleanup.py | ShiNik/marathon_machine_learning | 102041c9ccdf630e33cbcc19eadcde4151564228 | [
"MIT"
] | 1 | 2020-03-22T01:15:15.000Z | 2020-03-22T01:15:15.000Z | src/my_package/data_cleanup.py | BehNas/marathon_machine_learning | 9320e161a2e25eb3772f6eeb3ba5a292177ec6e7 | [
"MIT"
] | 2 | 2020-02-27T16:02:56.000Z | 2020-02-27T17:33:08.000Z | import pandas as pd
import numpy as np
def distance_calculation (df):
df['Time'] = pd.to_datetime(df['Time'])
df['Pace'] = pd.to_datetime(df['Pace'])
time = pd.to_timedelta(df['Time'].dt.strftime("%H:%M:%S")).dt.total_seconds().astype(int).to_numpy()
# convert %H:%M to %M:%S by dividing by 60
pace ... | 52.057143 | 115 | 0.681668 | import pandas as pd
import numpy as np
def distance_calculation (df):
df['Time'] = pd.to_datetime(df['Time'])
df['Pace'] = pd.to_datetime(df['Pace'])
time = pd.to_timedelta(df['Time'].dt.strftime("%H:%M:%S")).dt.total_seconds().astype(int).to_numpy()
pace = pd.to_timedelta(df['Pace'].dt.strftime("... | true | true |
f7f19df8a68815182391d65703a5331da66749f5 | 540 | py | Python | aggregables/sequences/lcs-suffix_tree.py | nevesnunes/aggregables | 8fb7ea1f97ceeb16c719312d0075294b19d098b3 | [
"MIT"
] | null | null | null | aggregables/sequences/lcs-suffix_tree.py | nevesnunes/aggregables | 8fb7ea1f97ceeb16c719312d0075294b19d098b3 | [
"MIT"
] | null | null | null | aggregables/sequences/lcs-suffix_tree.py | nevesnunes/aggregables | 8fb7ea1f97ceeb16c719312d0075294b19d098b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from suffix_trees.suffix_trees import STree
# Suffix-Tree example.
st = STree.STree("abc\x00defghab")
print(st.find("def")) # 0
print(st.find_all("ab")) # {0, 9}
st = STree.STree(b"abc\x00defghab")
print(st.find(b"def")) # 0
print(st.find_all(b"ab")) # {0, 9}
# Generalized Suffix-Tree exam... | 27 | 63 | 0.651852 |
from suffix_trees.suffix_trees import STree
st = STree.STree("abc\x00defghab")
print(st.find("def"))
print(st.find_all("ab"))
st = STree.STree(b"abc\x00defghab")
print(st.find(b"def"))
print(st.find_all(b"ab"))
a = ["xxxabcxxx", "adsaabc", "ytysabcrew", "qqqabcqw", "aaabc"]
st = STree.STree(a)
print(st.lc... | true | true |
f7f19e221b8e11b375271b324d64b268448c6be5 | 1,433 | py | Python | tests/test_queries.py | virdi/earthdata | d1ae730e8613d25033deadfafa89451b77ea56fc | [
"MIT"
] | null | null | null | tests/test_queries.py | virdi/earthdata | d1ae730e8613d25033deadfafa89451b77ea56fc | [
"MIT"
] | null | null | null | tests/test_queries.py | virdi/earthdata | d1ae730e8613d25033deadfafa89451b77ea56fc | [
"MIT"
] | null | null | null | # package imports
import pytest
from earthdata.search import DataCollections, DataGranules
valid_single_dates = [
("2001-12-12", "2001-12-21", "2001-12-12T00:00:00Z,2001-12-21T00:00:00Z"),
("2021-02-01", "", "2021-02-01T00:00:00Z,"),
("1999-02-01 06:00", "2009-01-01", "1999-02-01T06:00:00Z,2009-01-01T00:00... | 31.844444 | 84 | 0.678995 |
import pytest
from earthdata.search import DataCollections, DataGranules
valid_single_dates = [
("2001-12-12", "2001-12-21", "2001-12-12T00:00:00Z,2001-12-21T00:00:00Z"),
("2021-02-01", "", "2021-02-01T00:00:00Z,"),
("1999-02-01 06:00", "2009-01-01", "1999-02-01T06:00:00Z,2009-01-01T00:00:00Z"),
]
invali... | true | true |
f7f19feb27cd909608951e990c2435c63f40b89d | 1,137 | py | Python | cross-correlation/zncc.py | cirosantilli/algorithms-fork | 7fd932f460610136af01c1cdd70b0d3997b1d847 | [
"MIT"
] | 1 | 2018-10-04T15:12:37.000Z | 2018-10-04T15:12:37.000Z | cross-correlation/zncc.py | cirosantilli/algorithms-fork | 7fd932f460610136af01c1cdd70b0d3997b1d847 | [
"MIT"
] | null | null | null | cross-correlation/zncc.py | cirosantilli/algorithms-fork | 7fd932f460610136af01c1cdd70b0d3997b1d847 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def getAverage(img, u, v, n):
"""img as a square matrix of numbers"""
s = 0
for i in range(-n, n+1):
for j in range(-n, n+1):
s += img[u+i][v+j]
return float(s)/(2*n+1)**2
def getStandardDeviation(img, u, v, n):
s = 0
avg = getA... | 29.153846 | 68 | 0.512753 |
def getAverage(img, u, v, n):
s = 0
for i in range(-n, n+1):
for j in range(-n, n+1):
s += img[u+i][v+j]
return float(s)/(2*n+1)**2
def getStandardDeviation(img, u, v, n):
s = 0
avg = getAverage(img, u, v, n)
for i in range(-n, n+1):
for j in range(-n, n+1):
... | true | true |
f7f1a0346a05c13d71125b739cd221fb0b2225e4 | 354 | py | Python | tests/test_insertion.py | toriving/KoEDA | 5dfbb0e88ede13da2e5e72ac94fe7cb12c0b7cd1 | [
"MIT"
] | 48 | 2021-04-23T16:13:41.000Z | 2022-03-24T09:03:26.000Z | tests/test_insertion.py | toriving/KoEDA | 5dfbb0e88ede13da2e5e72ac94fe7cb12c0b7cd1 | [
"MIT"
] | 6 | 2020-11-19T13:56:29.000Z | 2021-09-26T12:13:23.000Z | tests/test_insertion.py | toriving/KoEDA | 5dfbb0e88ede13da2e5e72ac94fe7cb12c0b7cd1 | [
"MIT"
] | 3 | 2021-09-13T07:14:29.000Z | 2021-12-29T09:52:36.000Z | def test_str(RI, str_data):
assert RI(str_data, 0.8) != str_data
assert type(RI(str_data, 0.8)) is str
assert len(RI(str_data, 0.8, repetition=3)) == 3
def test_list(RI, list_data):
assert RI(list_data, 0.8) != list_data
assert type(RI(list_data, 0.8)) is list
assert len(RI(list_data, 0.8, rep... | 32.181818 | 70 | 0.658192 | def test_str(RI, str_data):
assert RI(str_data, 0.8) != str_data
assert type(RI(str_data, 0.8)) is str
assert len(RI(str_data, 0.8, repetition=3)) == 3
def test_list(RI, list_data):
assert RI(list_data, 0.8) != list_data
assert type(RI(list_data, 0.8)) is list
assert len(RI(list_data, 0.8, rep... | true | true |
f7f1a16ebeb28292437d18b95b152f4be7446e57 | 14,819 | py | Python | code/bib/neighbors/lof.py | ribes96/TFG | b38ac01da641e40551c1b3fefc1dc3ebd1b8b0a9 | [
"MIT"
] | null | null | null | code/bib/neighbors/lof.py | ribes96/TFG | b38ac01da641e40551c1b3fefc1dc3ebd1b8b0a9 | [
"MIT"
] | null | null | null | code/bib/neighbors/lof.py | ribes96/TFG | b38ac01da641e40551c1b3fefc1dc3ebd1b8b0a9 | [
"MIT"
] | null | null | null | # Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# License: BSD 3 clause
import numpy as np
import warnings
from scipy.stats import scoreatpercentile
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import U... | 41.98017 | 79 | 0.634928 |
import numpy as np
import warnings
from scipy.stats import scoreatpercentile
from .base import NeighborsBase
from .base import KNeighborsMixin
from .base import UnsupervisedMixin
from ..base import OutlierMixin
from ..utils.validation import check_is_fitted
from ..utils import check_array
__all__ = ["LocalOutlie... | true | true |
f7f1a1740efc36292fbb917d24b84a88544cbd25 | 40,478 | py | Python | src/legohdl/workspace.py | c-rus/legoHDL | d7d77c05514c8d6dc1070c4efe589f392307daac | [
"MIT"
] | 6 | 2021-12-16T05:40:37.000Z | 2022-02-07T15:04:39.000Z | src/legohdl/workspace.py | c-rus/legoHDL | d7d77c05514c8d6dc1070c4efe589f392307daac | [
"MIT"
] | 61 | 2021-09-28T03:05:13.000Z | 2022-01-16T00:03:14.000Z | src/legohdl/workspace.py | c-rus/legoHDL | d7d77c05514c8d6dc1070c4efe589f392307daac | [
"MIT"
] | 1 | 2021-12-16T07:03:18.000Z | 2021-12-16T07:03:18.000Z | # ------------------------------------------------------------------------------
# Project: legohdl
# Script: workspace.py
# Author: Chase Ruskin
# Description:
# The Workspace class. A Workspace object has a path and a list of available
# vendors. This is what the user keeps their work's scope within for a given
#... | 38.079022 | 186 | 0.531424 |
# "organization".
# ------------------------------------------------------------------------------
import os, shutil, glob
import logging as log
from datetime import datetime
from .vendor import Vendor
from .apparatus import Apparatus as apt
from .cfg import Cfg, Section, Key
from .map import Map
from .git i... | true | true |
f7f1a2026a60a2f2d0131c964891c813651675e9 | 2,857 | py | Python | app/grandchallenge/uploads/views.py | Tommos0/grand-challenge.org | 187cd857f6a7c9651b7bda8c42c54801f071dd7c | [
"Apache-2.0"
] | null | null | null | app/grandchallenge/uploads/views.py | Tommos0/grand-challenge.org | 187cd857f6a7c9651b7bda8c42c54801f071dd7c | [
"Apache-2.0"
] | null | null | null | app/grandchallenge/uploads/views.py | Tommos0/grand-challenge.org | 187cd857f6a7c9651b7bda8c42c54801f071dd7c | [
"Apache-2.0"
] | null | null | null | import ntpath
from django.contrib import messages
from django.contrib.sites.shortcuts import get_current_site
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.views.generic import ListView
from grandchallenge.core.permissions.mixins import Us... | 32.465909 | 79 | 0.652083 | import ntpath
from django.contrib import messages
from django.contrib.sites.shortcuts import get_current_site
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from django.views.generic import ListView
from grandchallenge.core.permissions.mixins import Us... | true | true |
f7f1a22b4d140bd6af875ee58fce0c97c5be689f | 917 | py | Python | Project/Python/project/public/base/dave_log.py | renwei-release/dave | 773301edd3bee6e7526e0d5587ff8af9f01e288f | [
"MIT"
] | null | null | null | Project/Python/project/public/base/dave_log.py | renwei-release/dave | 773301edd3bee6e7526e0d5587ff8af9f01e288f | [
"MIT"
] | null | null | null | Project/Python/project/public/base/dave_log.py | renwei-release/dave | 773301edd3bee6e7526e0d5587ff8af9f01e288f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#/*
# * Copyright (c) 2022 Renwei
# *
# * This is a free software; you can redistribute it and/or modify
# * it under the terms of the MIT license. See LICENSE for details.
# */
import string
import sys
import inspect
from ctypes import *
from .dave_dll import dave_dll
davelib = dave_dll()
d... | 22.365854 | 80 | 0.644493 |
import string
import sys
import inspect
from ctypes import *
from .dave_dll import dave_dll
davelib = dave_dll()
def _myline(depth):
__func__ = sys._getframe(depth).f_code.co_name.encode("utf-8")
__LINE__ = sys._getframe(depth).f_lineno
return __func__, __LINE__
def __dave_log__(*log_msg: objec... | true | true |
f7f1a29f67a579eeeee7cee79122404f5566833c | 3,174 | py | Python | cumulusci/core/runtime.py | leboff/CumulusCI | 81edbb1d64f2cc215a951c570052a1e423821cc1 | [
"BSD-3-Clause"
] | null | null | null | cumulusci/core/runtime.py | leboff/CumulusCI | 81edbb1d64f2cc215a951c570052a1e423821cc1 | [
"BSD-3-Clause"
] | null | null | null | cumulusci/core/runtime.py | leboff/CumulusCI | 81edbb1d64f2cc215a951c570052a1e423821cc1 | [
"BSD-3-Clause"
] | null | null | null | from abc import abstractmethod
import sys
from cumulusci.core.config import UniversalConfig, BaseProjectConfig
from cumulusci.core.exceptions import NotInProject, ProjectConfigNotFound
from cumulusci.core.keychain import BaseProjectKeychain
from cumulusci.core.flowrunner import FlowCallback, FlowCoordinator
from cumul... | 31.117647 | 82 | 0.688091 | from abc import abstractmethod
import sys
from cumulusci.core.config import UniversalConfig, BaseProjectConfig
from cumulusci.core.exceptions import NotInProject, ProjectConfigNotFound
from cumulusci.core.keychain import BaseProjectKeychain
from cumulusci.core.flowrunner import FlowCallback, FlowCoordinator
from cumul... | true | true |
f7f1a3ab21cb2fd817207251135d4f0fd92b5687 | 373 | py | Python | bloom/__init__.py | thomasrogers03/bloom | 5d49c18a241216aca354aa79971940691e6f33b4 | [
"Apache-2.0"
] | 9 | 2020-11-22T03:04:52.000Z | 2022-01-17T15:36:25.000Z | bloom/__init__.py | thomasrogers03/bloom | 5d49c18a241216aca354aa79971940691e6f33b4 | [
"Apache-2.0"
] | null | null | null | bloom/__init__.py | thomasrogers03/bloom | 5d49c18a241216aca354aa79971940691e6f33b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Thomas Rogers
# SPDX-License-Identifier: Apache-2.0
import os.path
try:
import pkg_resources
def find_resource(name: str):
return pkg_resources.resource_filename(
__name__, os.path.join("resources", name)
)
except ImportError:
def find_resource(name: str):
... | 19.631579 | 53 | 0.675603 |
import os.path
try:
import pkg_resources
def find_resource(name: str):
return pkg_resources.resource_filename(
__name__, os.path.join("resources", name)
)
except ImportError:
def find_resource(name: str):
return os.path.join("bloom/resources", name)
| true | true |
f7f1a45ecb1feceb2f3935cb965f0a5a57329b3b | 2,211 | py | Python | floodsystem/geo.py | tobiasallen26/CUED-Part-1A-flood-monitoring-and-warning-system | f830af4dda405eb4606f2cff31503f12f6df879d | [
"MIT"
] | null | null | null | floodsystem/geo.py | tobiasallen26/CUED-Part-1A-flood-monitoring-and-warning-system | f830af4dda405eb4606f2cff31503f12f6df879d | [
"MIT"
] | null | null | null | floodsystem/geo.py | tobiasallen26/CUED-Part-1A-flood-monitoring-and-warning-system | f830af4dda405eb4606f2cff31503f12f6df879d | [
"MIT"
] | 1 | 2022-02-02T16:54:38.000Z | 2022-02-02T16:54:38.000Z | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
"""This module contains a collection of functions related to
geographical data.
"""
from floodsystem.stationdata import build_station_list
from .utils import sorted_by_key # noqa
from haversine import haversine
def stations_by_distance(stations, p... | 30.708333 | 95 | 0.682949 |
from floodsystem.stationdata import build_station_list
from .utils import sorted_by_key
from haversine import haversine
def stations_by_distance(stations, p):
station_distance = []
for s in stations:
station_distance.append((s, haversine(s.coord, p)))
station_distance = sorted_by_key(sta... | true | true |
f7f1a52d24b163616af6bfb4e08a8a6eb5200b0e | 387 | py | Python | 2_analysis/.ipynb_checkpoints/constants-checkpoint.py | lukas-pkl/presidential_attention | 015ff5bcf05577f5b43c976007e02162be2b11d6 | [
"MIT"
] | null | null | null | 2_analysis/.ipynb_checkpoints/constants-checkpoint.py | lukas-pkl/presidential_attention | 015ff5bcf05577f5b43c976007e02162be2b11d6 | [
"MIT"
] | null | null | null | 2_analysis/.ipynb_checkpoints/constants-checkpoint.py | lukas-pkl/presidential_attention | 015ff5bcf05577f5b43c976007e02162be2b11d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Constants for scrapers
Created: 2021 12 22
Author: lukasp
"""
mongo_conn_string = """mongodb://localhost:27017/?readPreference=primary&appname=MongoDB%20Compass&ssl=false"""
mongo_db = "delfi_texts"
mongo_lt_col = "lt_news"
mongo_lt_annotated_col = "annotated"
mon... | 20.368421 | 111 | 0.749354 |
mongo_conn_string = """mongodb://localhost:27017/?readPreference=primary&appname=MongoDB%20Compass&ssl=false"""
mongo_db = "delfi_texts"
mongo_lt_col = "lt_news"
mongo_lt_annotated_col = "annotated"
mongo_lt_col = "lv_news"
mongo_lv_annotated_col = "lv_news_annotated"
| true | true |
f7f1a67a34fa1bf8ce7fd2d2c942aea80f11f8fe | 94 | py | Python | featuretools/tests/test_version.py | seriallazer/featuretools | c51ef4e2944bb754de5696833b480b316916202a | [
"BSD-3-Clause"
] | null | null | null | featuretools/tests/test_version.py | seriallazer/featuretools | c51ef4e2944bb754de5696833b480b316916202a | [
"BSD-3-Clause"
] | null | null | null | featuretools/tests/test_version.py | seriallazer/featuretools | c51ef4e2944bb754de5696833b480b316916202a | [
"BSD-3-Clause"
] | null | null | null | from featuretools import __version__
def test_version():
assert __version__ == "0.21.0"
| 15.666667 | 36 | 0.734043 | from featuretools import __version__
def test_version():
assert __version__ == "0.21.0"
| true | true |
f7f1a7fadb6e0b13bb64f6c18ecabefb3949b39b | 12,743 | py | Python | pandas/tests/indexes/period/test_setops.py | kpflugshaupt/pandas | c9e3883c630c48b17218e6bcc5593720c1402bf1 | [
"BSD-3-Clause"
] | 2 | 2021-04-07T13:56:06.000Z | 2021-04-12T13:45:23.000Z | pandas/tests/indexes/period/test_setops.py | sanjusci/pandas | a1fee9199eba7ebf423880243936b9f1501d3d3a | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/period/test_setops.py | sanjusci/pandas | a1fee9199eba7ebf423880243936b9f1501d3d3a | [
"BSD-3-Clause"
] | 3 | 2018-01-08T08:40:55.000Z | 2019-10-07T02:02:40.000Z | import numpy as np
import pytest
import pandas as pd
from pandas import Index, PeriodIndex, date_range, period_range
import pandas.core.indexes.period as period
import pandas.util.testing as tm
def _permute(obj):
return obj.take(np.random.permutation(len(obj)))
class TestPeriodIndex(object):
def test_join... | 44.093426 | 78 | 0.509535 | import numpy as np
import pytest
import pandas as pd
from pandas import Index, PeriodIndex, date_range, period_range
import pandas.core.indexes.period as period
import pandas.util.testing as tm
def _permute(obj):
return obj.take(np.random.permutation(len(obj)))
class TestPeriodIndex(object):
def test_join... | true | true |
f7f1a8477e0540d0ee6c14c0b5eb86f7d8803b22 | 367 | py | Python | django_project/spa/forms.py | Zinko17/DjangoProject | b30ff2862001e98152039549165360c7f8481220 | [
"MIT"
] | null | null | null | django_project/spa/forms.py | Zinko17/DjangoProject | b30ff2862001e98152039549165360c7f8481220 | [
"MIT"
] | null | null | null | django_project/spa/forms.py | Zinko17/DjangoProject | b30ff2862001e98152039549165360c7f8481220 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class RegisterForm(UserCreationForm):
name = forms.CharField()
age = forms.IntegerField()
email = forms.EmailField()
class Meta:
model = User
fields = ['name','a... | 28.230769 | 74 | 0.705722 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class RegisterForm(UserCreationForm):
name = forms.CharField()
age = forms.IntegerField()
email = forms.EmailField()
class Meta:
model = User
fields = ['name','a... | true | true |
f7f1a8e1150eadc52ac21d7a3d6f23b75a88b01e | 5,788 | py | Python | pyglm/utils/io.py | slinderman/theano_pyglm | c7fc11069dfe91b0eb7c96b8464fcd0f57442952 | [
"MIT"
] | 37 | 2015-04-08T15:11:51.000Z | 2022-01-05T19:32:58.000Z | pyglm/utils/io.py | slinderman/theano_pyglm | c7fc11069dfe91b0eb7c96b8464fcd0f57442952 | [
"MIT"
] | 2 | 2016-03-08T02:39:58.000Z | 2017-03-29T08:51:08.000Z | pyglm/utils/io.py | slinderman/theano_pyglm | c7fc11069dfe91b0eb7c96b8464fcd0f57442952 | [
"MIT"
] | 10 | 2015-02-25T21:47:50.000Z | 2020-03-06T00:21:48.000Z | import cPickle
import os
import numpy as np
def parse_cmd_line_args():
"""
Parse command line parameters
"""
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-m", "--model", dest="model", default='standard_glm',
help="Type of model to use. See ... | 38.078947 | 109 | 0.6085 | import cPickle
import os
import numpy as np
def parse_cmd_line_args():
"""
Parse command line parameters
"""
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-m", "--model", dest="model", default='standard_glm',
help="Type of model to use. See ... | false | true |
f7f1a92b4ec5f5956ded6e03ea9a3544eee59358 | 386 | py | Python | src/app/training/migrations/0013_drop_lang_id.py | serious-notreally/cappa | 993a8df35ca6c3b22f3ca811937fd29c07fc71aa | [
"MIT"
] | 9 | 2020-04-05T07:35:55.000Z | 2021-08-03T05:50:05.000Z | src/app/training/migrations/0013_drop_lang_id.py | serious-notreally/cappa | 993a8df35ca6c3b22f3ca811937fd29c07fc71aa | [
"MIT"
] | 89 | 2020-01-26T11:50:06.000Z | 2022-03-31T07:14:18.000Z | src/app/training/migrations/0013_drop_lang_id.py | serious-notreally/cappa | 993a8df35ca6c3b22f3ca811937fd29c07fc71aa | [
"MIT"
] | 13 | 2020-03-10T14:45:07.000Z | 2021-07-31T02:43:40.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-01-08 08:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('training', '0012_course_translator'),
]
operations = [
migrations.RunSQL('... | 22.705882 | 86 | 0.69171 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('training', '0012_course_translator'),
]
operations = [
migrations.RunSQL('ALTER TABLE training_course DROP COLUMN IF EXISTS lang_id')
]
| true | true |
f7f1a953e92b8b76199f302a74f6577c14f6f029 | 13,505 | py | Python | samples/openapi3/client/petstore/python/petstore_api/model/pig.py | jackma46/openapi-generator | eeb00e27d13fb0c578c1c4159c0c7bddfcb21082 | [
"Apache-2.0"
] | 11,868 | 2018-05-12T02:58:07.000Z | 2022-03-31T21:19:39.000Z | samples/openapi3/client/petstore/python/petstore_api/model/pig.py | jackma46/openapi-generator | eeb00e27d13fb0c578c1c4159c0c7bddfcb21082 | [
"Apache-2.0"
] | 9,672 | 2018-05-12T14:25:43.000Z | 2022-03-31T23:59:30.000Z | samples/openapi3/client/petstore/python/petstore_api/model/pig.py | jackma46/openapi-generator | eeb00e27d13fb0c578c1c4159c0c7bddfcb21082 | [
"Apache-2.0"
] | 4,776 | 2018-05-12T12:06:08.000Z | 2022-03-31T19:52:51.000Z | """
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noq... | 42.071651 | 174 | 0.580378 |
import re
import sys
from petstore_api.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
from ... | true | true |
f7f1a99695360c1a254fc90beef01ba8192c8310 | 8,818 | py | Python | app/analyse/project_updater.py | luyaor/INFOX | 56e028bd7be36873fc9aa8d40cd3d98c998acee8 | [
"MIT"
] | 3 | 2020-03-08T18:19:19.000Z | 2022-03-31T20:15:55.000Z | app/analyse/project_updater.py | vicky-xu-sh/INFOX | 9977582075b2906bd34d577b0ee0873fb38f0531 | [
"MIT"
] | 3 | 2020-02-23T14:37:13.000Z | 2021-02-08T20:28:28.000Z | app/analyse/project_updater.py | luyaor/INFOX | 56e028bd7be36873fc9aa8d40cd3d98c998acee8 | [
"MIT"
] | 3 | 2020-02-18T15:13:33.000Z | 2021-08-15T14:38:51.000Z | import os
import json
from collections import OrderedDict
from datetime import datetime
from flask import current_app
from . import compare_changes_crawler
from . import source_code_analyser
from .util import word_extractor
from .util import localfile_tool
from .clone_crawler import CloneCrawler
from ..models import *... | 44.761421 | 193 | 0.661941 | import os
import json
from collections import OrderedDict
from datetime import datetime
from flask import current_app
from . import compare_changes_crawler
from . import source_code_analyser
from .util import word_extractor
from .util import localfile_tool
from .clone_crawler import CloneCrawler
from ..models import *... | true | true |
f7f1ab1a0ed32abbe6b2f296913c26a5667aad17 | 1,139 | py | Python | solutions/problem_177.py | ksvr444/daily-coding-problem | 5d9f488f81c616847ee4e9e48974523ec2d598d7 | [
"MIT"
] | 1,921 | 2018-11-13T18:19:56.000Z | 2021-11-15T14:25:41.000Z | solutions/problem_177.py | MohitIndian/daily-coding-problem | 5d9f488f81c616847ee4e9e48974523ec2d598d7 | [
"MIT"
] | 2 | 2019-07-19T01:06:16.000Z | 2019-08-01T22:21:36.000Z | solutions/problem_177.py | MohitIndian/daily-coding-problem | 5d9f488f81c616847ee4e9e48974523ec2d598d7 | [
"MIT"
] | 1,066 | 2018-11-19T19:06:55.000Z | 2021-11-13T12:33:56.000Z | class Node:
def __init__(self, x):
self.val = x
self.next = None
def __str__(self):
string = "["
node = self
while node:
string += "{} ->".format(node.val)
node = node.next
string += "None]"
return string
def get_nodes(values):
... | 18.983333 | 76 | 0.536435 | class Node:
def __init__(self, x):
self.val = x
self.next = None
def __str__(self):
string = "["
node = self
while node:
string += "{} ->".format(node.val)
node = node.next
string += "None]"
return string
def get_nodes(values):
... | true | true |
f7f1ab4f57d5e17789ffcb34282f9530b1cfb204 | 2,402 | py | Python | healthcareai/common/table_archiver.py | vijayphugat/Practice | 7d8560d62a5d6bfa9488526da318973295a25255 | [
"MIT"
] | null | null | null | healthcareai/common/table_archiver.py | vijayphugat/Practice | 7d8560d62a5d6bfa9488526da318973295a25255 | [
"MIT"
] | null | null | null | healthcareai/common/table_archiver.py | vijayphugat/Practice | 7d8560d62a5d6bfa9488526da318973295a25255 | [
"MIT"
] | null | null | null | import time
import datetime
import pandas as pd
from healthcareai.common.healthcareai_error import HealthcareAIError
def table_archiver(server, database, source_table, destination_table, timestamp_column_name='ArchivedDTS'):
"""
Takes a table and archives a complete copy of it with the addition of a... | 35.850746 | 120 | 0.678185 | import time
import datetime
import pandas as pd
from healthcareai.common.healthcareai_error import HealthcareAIError
def table_archiver(server, database, source_table, destination_table, timestamp_column_name='ArchivedDTS'):
if type(server) is not str:
raise HealthcareAIError('Please specif... | true | true |
f7f1ab7e742c3af3fd1bbf0a9fc2d0fbb5adaf44 | 208 | py | Python | junction/profiles/urls.py | theSage21/junction | ac713edcf56c41eb3f066da776a0a5d24e55b46a | [
"MIT"
] | 192 | 2015-01-12T06:21:24.000Z | 2022-03-10T09:57:37.000Z | junction/profiles/urls.py | theSage21/junction | ac713edcf56c41eb3f066da776a0a5d24e55b46a | [
"MIT"
] | 621 | 2015-01-01T09:19:17.000Z | 2021-05-28T09:27:35.000Z | junction/profiles/urls.py | theSage21/junction | ac713edcf56c41eb3f066da776a0a5d24e55b46a | [
"MIT"
] | 207 | 2015-01-05T16:39:06.000Z | 2022-02-15T13:18:15.000Z | from django.conf.urls import url
from . import views
app_name = "junction.profiles"
urlpatterns = [
url(r"^$", views.dashboard, name="dashboard"),
url(r"^edit/$", views.profile, name="profile"),
]
| 18.909091 | 51 | 0.668269 | from django.conf.urls import url
from . import views
app_name = "junction.profiles"
urlpatterns = [
url(r"^$", views.dashboard, name="dashboard"),
url(r"^edit/$", views.profile, name="profile"),
]
| true | true |
f7f1ab8130938f88f5f185addf5a1b93049c1a5c | 393 | py | Python | contrail_provisioning/config/templates/contrail_api_svc.py | atsgen/contrail-provisioning | dda84a5ed7e17b5cc7148c2505e66ed3e8a86120 | [
"Apache-2.0"
] | 2 | 2015-10-29T19:36:26.000Z | 2016-04-19T13:24:00.000Z | contrail_provisioning/config/templates/contrail_api_svc.py | atsgen/contrail-provisioning | dda84a5ed7e17b5cc7148c2505e66ed3e8a86120 | [
"Apache-2.0"
] | 1 | 2017-07-03T09:10:18.000Z | 2017-07-03T09:10:18.000Z | contrail_provisioning/config/templates/contrail_api_svc.py | atsgen/contrail-provisioning | dda84a5ed7e17b5cc7148c2505e66ed3e8a86120 | [
"Apache-2.0"
] | 18 | 2016-01-14T23:10:39.000Z | 2021-12-13T06:32:38.000Z | import string
template = string.Template("""
#!/bin/sh
# chkconfig: 2345 99 01
# description: Juniper Network Virtualization API
$__contrail_supervisorctl_lines__
#if os.path.exists('/tmp/supervisord_config.sock'):
# supervisorctl -s unix:///tmp/supervisord_config.sock ${1} `basename ${0}`
#else:
# supervisor... | 24.5625 | 82 | 0.717557 | import string
template = string.Template("""
#!/bin/sh
# chkconfig: 2345 99 01
# description: Juniper Network Virtualization API
$__contrail_supervisorctl_lines__
#if os.path.exists('/tmp/supervisord_config.sock'):
# supervisorctl -s unix:///tmp/supervisord_config.sock ${1} `basename ${0}`
#else:
# supervisor... | true | true |
f7f1abe73845997d35eed3c78cc39f42d4ffec99 | 3,910 | py | Python | ros/src/tl_detector/tl_detector.py | ms802x/CarND-Capstone | efd6606090b2395cb49f71b0eb53393f859a5e39 | [
"MIT"
] | null | null | null | ros/src/tl_detector/tl_detector.py | ms802x/CarND-Capstone | efd6606090b2395cb49f71b0eb53393f859a5e39 | [
"MIT"
] | null | null | null | ros/src/tl_detector/tl_detector.py | ms802x/CarND-Capstone | efd6606090b2395cb49f71b0eb53393f859a5e39 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classification.tl_classifier import TLCla... | 30.787402 | 128 | 0.618159 |
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classification.tl_classifier import TLClassifier
import tf
imp... | true | true |
f7f1ac07d51ab96eff4b68e49d69f9d98591bae3 | 1,327 | py | Python | MorvanZhou/tf19_saver.py | SeanSyue/TensorflowReferences | 2c93f4c770e2713ef4769f287e022d03e7097188 | [
"MIT"
] | null | null | null | MorvanZhou/tf19_saver.py | SeanSyue/TensorflowReferences | 2c93f4c770e2713ef4769f287e022d03e7097188 | [
"MIT"
] | null | null | null | MorvanZhou/tf19_saver.py | SeanSyue/TensorflowReferences | 2c93f4c770e2713ef4769f287e022d03e7097188 | [
"MIT"
] | null | null | null | from __future__ import print_function
import tensorflow as tf
import numpy as np
# # Save to file
# # remember to define the same dtype and shape when restore
# W = tf.Variable([[1,2,3],[3,4,5]], dtype=tf.float32, name='weights')
# b = tf.Variable([[1,2,3]], dtype=tf.float32, name='biases')
#
# # tf.initializ... | 34.921053 | 112 | 0.609646 | from __future__ import print_function
import tensorflow as tf
import numpy as np
| true | true |
f7f1ac6c0b120be6fe956ed2aaa19855d7ff8751 | 1,473 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/live/apis/DeleteLiveStreamAppTranscodeRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/live/apis/DeleteLiveStreamAppTranscodeRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/live/apis/DeleteLiveStreamAppTranscodeRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 30.061224 | 112 | 0.71962 |
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
class DeleteLiveStreamAppTranscodeRequest(JDCloudRequest):
def __init__(self, parameters, header=None, version="v1"):
super(DeleteLiveStreamAppTranscodeRequest, self).__init__(
'/transcodeApps/{publishDomain}/appName... | true | true |
f7f1ad6db253d6d19a007d11840017f927d0239d | 147 | py | Python | tests/web_platform/CSS2/box_display/test_display_change.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/CSS2/box_display/test_display_change.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/CSS2/box_display/test_display_change.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | 1 | 2020-01-16T01:56:41.000Z | 2020-01-16T01:56:41.000Z | from tests.utils import W3CTestCase
class TestDisplayChange(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'display-change-'))
| 24.5 | 70 | 0.789116 | from tests.utils import W3CTestCase
class TestDisplayChange(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'display-change-'))
| true | true |
f7f1adf7061aba67b5afcf455f7fca3ad917dfce | 151 | py | Python | rwge/urls.py | rwgeaston/django-rwge | 197779531a99de1077feea656ac79be1c5a8119c | [
"MIT"
] | null | null | null | rwge/urls.py | rwgeaston/django-rwge | 197779531a99de1077feea656ac79be1c5a8119c | [
"MIT"
] | null | null | null | rwge/urls.py | rwgeaston/django-rwge | 197779531a99de1077feea656ac79be1c5a8119c | [
"MIT"
] | null | null | null | from django.urls import path
from django.conf import settings
from .views import rwge_view
urlpatterns = [
path(settings.RWGE_URL, rwge_view),
]
| 16.777778 | 39 | 0.768212 | from django.urls import path
from django.conf import settings
from .views import rwge_view
urlpatterns = [
path(settings.RWGE_URL, rwge_view),
]
| true | true |
f7f1af718569e13e22b526b1b8a7bba4d09c5016 | 1,872 | py | Python | 2D_ObjectDetectors/yolov1/network/test/test_loss.py | loaywael/ObjectDetection | 9006cfdb2284a83426510a70c894824b27f40566 | [
"Apache-2.0"
] | null | null | null | 2D_ObjectDetectors/yolov1/network/test/test_loss.py | loaywael/ObjectDetection | 9006cfdb2284a83426510a70c894824b27f40566 | [
"Apache-2.0"
] | null | null | null | 2D_ObjectDetectors/yolov1/network/test/test_loss.py | loaywael/ObjectDetection | 9006cfdb2284a83426510a70c894824b27f40566 | [
"Apache-2.0"
] | null | null | null | from network.loss import YoloLoss
from unittest import TestCase
import numpy as np
import torch
from network.dataset import VOCDataset
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import os
torch.manual_seed(13)
DATA_DIR = "data/pascal_voc_yolo/"
IMG_DIR = DATA_DIR+"images/"
LABEL_DIR = DATA... | 27.940299 | 95 | 0.540064 | from network.loss import YoloLoss
from unittest import TestCase
import numpy as np
import torch
from network.dataset import VOCDataset
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import os
torch.manual_seed(13)
DATA_DIR = "data/pascal_voc_yolo/"
IMG_DIR = DATA_DIR+"images/"
LABEL_DIR = DATA... | true | true |
f7f1af7770ffc2df5a92d6b96bbe9fac2d7b8f21 | 2,716 | py | Python | DaemonCerts/UNITYInitializerWriter.py | timostrunk/UNICOREDaemonCerts | 0dd3c78c48d3384a5ecb55464fc46af5c8c3e03e | [
"BSD-3-Clause"
] | null | null | null | DaemonCerts/UNITYInitializerWriter.py | timostrunk/UNICOREDaemonCerts | 0dd3c78c48d3384a5ecb55464fc46af5c8c3e03e | [
"BSD-3-Clause"
] | null | null | null | DaemonCerts/UNITYInitializerWriter.py | timostrunk/UNICOREDaemonCerts | 0dd3c78c48d3384a5ecb55464fc46af5c8c3e03e | [
"BSD-3-Clause"
] | 1 | 2021-02-02T12:48:36.000Z | 2021-02-02T12:48:36.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
def write_groovy_script(dn_list):
template = """
/*
* Script adding UNICORE server DN to /unicore/servers group.
*
* Depends on unicoreContentInitializer.groovy
*/
im... | 33.95 | 116 | 0.708027 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
def write_groovy_script(dn_list):
template = """
/*
* Script adding UNICORE server DN to /unicore/servers group.
*
* Depends on unicoreContentInitializer.groovy
*/
import java.util.Map;
im... | true | true |
f7f1af7f5acce3121765f0b1f4c3a79965910322 | 1,487 | py | Python | auctions/models.py | amogyisabogy1/Filesharing | bc1d318af015cd3ede4710ca7c2f1ed823c205e4 | [
"MIT"
] | null | null | null | auctions/models.py | amogyisabogy1/Filesharing | bc1d318af015cd3ede4710ca7c2f1ed823c205e4 | [
"MIT"
] | null | null | null | auctions/models.py | amogyisabogy1/Filesharing | bc1d318af015cd3ede4710ca7c2f1ed823c205e4 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
# this is the model for users and it inherits AbstractUser
class User(AbstractUser):
pass
# model for listings
class Listing(models.Model):
seller = models.CharField(max_length=64)
title = models.CharField(max_length=64)
... | 29.156863 | 81 | 0.737054 | from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
pass
class Listing(models.Model):
seller = models.CharField(max_length=64)
title = models.CharField(max_length=64)
description = models.TextField()
category = models.CharField(max_length=... | true | true |
f7f1af9eac2b318e5574b29e0edd6dc7f809c8a7 | 1,487 | py | Python | MiscScripts/_voiceLogger.py | mrob95/natlink | dc806ab62da89b7bb3d3683387af00c696601e16 | [
"MIT"
] | null | null | null | MiscScripts/_voiceLogger.py | mrob95/natlink | dc806ab62da89b7bb3d3683387af00c696601e16 | [
"MIT"
] | null | null | null | MiscScripts/_voiceLogger.py | mrob95/natlink | dc806ab62da89b7bb3d3683387af00c696601e16 | [
"MIT"
] | null | null | null | # Natlink recognition logger.
# (c) 2005 Daniel J. Rocco
#
# Logs NaturallySpeaking's recognition history to the specified file.
# Format:
# timestamp current_user current_module window_title (recognized word list | '*REJECT*')
#
# modeled on Joel Gould's "repeat that" grammar.
#
... | 28.056604 | 123 | 0.653665 |
# Format:
# timestamp current_user current_module window_title (recognized word list | '*REJECT*')
#
# modeled on Joel Gould's "repeat that" grammar.
import natlink, time, string
from natlinkutils import *
logFile = r'C:\dev\DotNetProjects\NatLink\macrosystem\voice.log'
def ... | true | true |
f7f1b1eabdd17b378900e39dd86de8fd9eb4a239 | 4,197 | py | Python | Co-Simulation/PTV-Vissim/vissim_integration/carla_simulation.py | adelbennaceur/carla | 4d6fefe73d38f0ffaef8ffafccf71245699fc5db | [
"MIT"
] | 1 | 2020-05-17T13:39:25.000Z | 2020-05-17T13:39:25.000Z | Co-Simulation/PTV-Vissim/vissim_integration/carla_simulation.py | adelbennaceur/carla | 4d6fefe73d38f0ffaef8ffafccf71245699fc5db | [
"MIT"
] | 2 | 2021-03-31T19:58:35.000Z | 2021-12-13T20:47:16.000Z | Co-Simulation/PTV-Vissim/vissim_integration/carla_simulation.py | adelbennaceur/carla | 4d6fefe73d38f0ffaef8ffafccf71245699fc5db | [
"MIT"
] | 2 | 2021-06-07T13:22:33.000Z | 2022-02-17T08:14:27.000Z | #!/usr/bin/env python
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
""" This module is responsible for the management of the carla simulation. """... | 36.495652 | 100 | 0.549678 |
import logging
import carla
from .constants import INVALID_ACTOR_ID, CARLA_SPAWN_OFFSET_Z
class CarlaSimulation(object):
def __init__(self, args):
self.args = args
host = args.carla_host
port = args.carla_port
self.client = carla.Client(host, port)
self... | true | true |
f7f1b4415132d59b42a4502f8107d093d3ed7131 | 2,656 | py | Python | larcv/app/arxiv/arxiv/dbscan/visdbscanclusters.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 14 | 2017-10-19T15:08:29.000Z | 2021-03-31T21:21:07.000Z | larcv/app/arxiv/arxiv/dbscan/visdbscanclusters.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 32 | 2017-10-25T22:54:06.000Z | 2019-10-01T13:57:15.000Z | larcv/app/arxiv/arxiv/dbscan/visdbscanclusters.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 16 | 2017-12-07T12:04:40.000Z | 2021-11-15T00:53:31.000Z | import os,sys
import pyqtgraph as pg
from pyqtgraph import PlotDataItem
import numpy as np
from larcv import larcv
class VisDBScanClusters:
COLORS = [ (76,0,153,125), # purple
(102,255,102), # green
(51,255,255), # cyan
(255,128,0), # orange
(0,76,... | 35.413333 | 160 | 0.487199 | import os,sys
import pyqtgraph as pg
from pyqtgraph import PlotDataItem
import numpy as np
from larcv import larcv
class VisDBScanClusters:
COLORS = [ (76,0,153,125),
(102,255,102),
(51,255,255),
(255,128,0),
(0,76,153),
(20... | false | true |
f7f1b47387874e82b411e793d1a512b274451649 | 10,783 | py | Python | io_tests/test_file_io.py | oeclint/fvcore | 40718f0ddcd37f82a328b1765ec9362c1f8aa894 | [
"Apache-2.0"
] | null | null | null | io_tests/test_file_io.py | oeclint/fvcore | 40718f0ddcd37f82a328b1765ec9362c1f8aa894 | [
"Apache-2.0"
] | null | null | null | io_tests/test_file_io.py | oeclint/fvcore | 40718f0ddcd37f82a328b1765ec9362c1f8aa894 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import os
import shutil
import tempfile
import unittest
import uuid
from typing import Optional
from unittest.mock import MagicMock
from fvcore.common.file_io import LazyPath, PathManager, get_cache_dir
class TestNativeIO(unittest.TestCase):
... | 38.648746 | 87 | 0.629417 |
import os
import shutil
import tempfile
import unittest
import uuid
from typing import Optional
from unittest.mock import MagicMock
from fvcore.common.file_io import LazyPath, PathManager, get_cache_dir
class TestNativeIO(unittest.TestCase):
_tmpdir: Optional[str] = None
_tmpfile: Optional[str] = None
... | true | true |
f7f1b5139a155b4f4a086a9db0af60962cd5b3a8 | 1,788 | py | Python | vindinium-python/vindinium/__init__.py | Mosfreds/vindinium_rl | de572ff01fcbd8da8581bf2d47e0ae811a58eb44 | [
"MIT"
] | null | null | null | vindinium-python/vindinium/__init__.py | Mosfreds/vindinium_rl | de572ff01fcbd8da8581bf2d47e0ae811a58eb44 | [
"MIT"
] | null | null | null | vindinium-python/vindinium/__init__.py | Mosfreds/vindinium_rl | de572ff01fcbd8da8581bf2d47e0ae811a58eb44 | [
"MIT"
] | null | null | null | """Awesome python client for Vindinium.
Vindinium is an online and continuous competition where you control a bot in a
turn-based game, consult `the site <http://vindinium.org>`_ to know more.
Note: this client is based on the `ornicar's client
<https://github.com/ornicar/vindinium-starter-python>`_.
This library pro... | 28.380952 | 80 | 0.711969 |
from .client import *
from . import bots
from . import models
from . import ai
from . import utils
TILE_EMPTY = 0
TILE_WALL = 1
TILE_SPAWN = 2
TILE_TAVERN = 3
TILE_MINE = 4
NORTH = 'North'
SOUTH = 'South'
WEST = 'West'
EAST = 'East'
STAY = 'Stay'
DIR_NORTH = ( 0, -1)
DIR_SOUTH = ( 0, 1)
DIR_WEST = (-... | true | true |
f7f1b5c4c4f8b8295436d62424970ad8a6a1e6f3 | 1,202 | py | Python | interpreter/temp-code.py | sarahkittyy/Functoral | cf63d6279614378fb82d1ffd8a2dc8b8df6039f8 | [
"MIT"
] | null | null | null | interpreter/temp-code.py | sarahkittyy/Functoral | cf63d6279614378fb82d1ffd8a2dc8b8df6039f8 | [
"MIT"
] | null | null | null | interpreter/temp-code.py | sarahkittyy/Functoral | cf63d6279614378fb82d1ffd8a2dc8b8df6039f8 | [
"MIT"
] | null | null | null | def getInnerBlocks(string, begin, end, sep = [","]):
ret_list = []
if not isinstance(string, str):
return None
# read a name until depth 1. Store until depth 0, and append it along with
# the contents.
# at depth 0, ignore separators
cname = ""
depth = 0
last_name = ""
cstr = ""
clist = []
for char in ... | 20.372881 | 75 | 0.567388 | def getInnerBlocks(string, begin, end, sep = [","]):
ret_list = []
if not isinstance(string, str):
return None
cname = ""
depth = 0
last_name = ""
cstr = ""
clist = []
for char in string:
if char == end:
depth -= 1
if depth == 0:
clist.append(cstr)
ret_list.append({
'name': last... | true | true |
f7f1b729e5010890ae98bce2b8e97e3359fcf76b | 4,390 | py | Python | molecule/command/destroy.py | westurner/molecule | 1babb77a8785192be38ab122e8206a0e53777b83 | [
"MIT"
] | null | null | null | molecule/command/destroy.py | westurner/molecule | 1babb77a8785192be38ab122e8206a0e53777b83 | [
"MIT"
] | null | null | null | molecule/command/destroy.py | westurner/molecule | 1babb77a8785192be38ab122e8206a0e53777b83 | [
"MIT"
] | null | null | null | # Copyright (c) 2015-2018 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... | 28.322581 | 82 | 0.673121 |
import os
import click
from molecule import logger
from molecule.api import drivers
from molecule.command import base
from molecule import util
LOG = logger.get_logger(__name__)
MOLECULE_PARALLEL = os.environ.get('MOLECULE_PARALLEL', False)
class Destroy(base.Base):
def execute(self):
... | true | true |
f7f1b745cbe33096d2ab7c028249b248e85e9fcf | 37,429 | py | Python | tensorflow_examples/lite/model_maker/third_party/efficientdet/keras/efficientdet_keras.py | AmolShahh/examples | 9321bae747548a70d9667752a5334e5330b1ce49 | [
"Apache-2.0"
] | 2 | 2021-10-05T05:33:26.000Z | 2021-10-05T05:51:02.000Z | tensorflow_examples/lite/model_maker/third_party/efficientdet/keras/efficientdet_keras.py | AmolShahh/examples | 9321bae747548a70d9667752a5334e5330b1ce49 | [
"Apache-2.0"
] | 1 | 2022-02-09T23:28:48.000Z | 2022-02-09T23:28:48.000Z | tensorflow_examples/lite/model_maker/third_party/efficientdet/keras/efficientdet_keras.py | AmolShahh/examples | 9321bae747548a70d9667752a5334e5330b1ce49 | [
"Apache-2.0"
] | 1 | 2021-09-20T03:17:50.000Z | 2021-09-20T03:17:50.000Z | # Copyright 2020 Google Research. 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... | 36.695098 | 103 | 0.642256 |
import functools
from absl import logging
import numpy as np
import tensorflow as tf
from tensorflow_examples.lite.model_maker.third_party.efficientdet import dataloader
from tensorflow_examples.lite.model_maker.third_party.efficientdet import hparams_config
from tensorflow_examples.lite.model_maker.thir... | true | true |
f7f1b864af7bffc236b2e090da0badb91cdf37ab | 393 | py | Python | sandbox/apps/checkout/forms.py | django-oscar/django-oscar-docdata | 8f95458d4dff7d27ec507bacfede0a19e1f0e6b2 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2017-04-25T10:31:27.000Z | 2022-03-01T10:58:10.000Z | sandbox/apps/checkout/forms.py | django-oscar/django-oscar-docdata | 8f95458d4dff7d27ec507bacfede0a19e1f0e6b2 | [
"ECL-2.0",
"Apache-2.0"
] | 45 | 2017-04-26T13:17:51.000Z | 2022-02-16T12:27:57.000Z | sandbox/apps/checkout/forms.py | django-oscar/django-oscar-docdata | 8f95458d4dff7d27ec507bacfede0a19e1f0e6b2 | [
"ECL-2.0",
"Apache-2.0"
] | 7 | 2017-07-18T03:43:53.000Z | 2020-07-10T16:29:30.000Z | from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
class PaymentMethodForm(forms.Form):
"""
Extra form for the custom payment method.
"""
payment_method = forms.ChoiceField(
label=_("Choose your payment method"),
choices=se... | 26.2 | 55 | 0.715013 | from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
class PaymentMethodForm(forms.Form):
payment_method = forms.ChoiceField(
label=_("Choose your payment method"),
choices=settings.WEBSHOP_PAYMENT_CHOICES,
widget=forms.RadioSele... | true | true |
f7f1b8af2bcc886eb13a7f733c4b313419623c1c | 319 | py | Python | 42.fruit_or_vegetable.py | krisskax348/python_basics | 5af1ef6da1d88c912c1804a8cde11fbabe535691 | [
"MIT"
] | null | null | null | 42.fruit_or_vegetable.py | krisskax348/python_basics | 5af1ef6da1d88c912c1804a8cde11fbabe535691 | [
"MIT"
] | null | null | null | 42.fruit_or_vegetable.py | krisskax348/python_basics | 5af1ef6da1d88c912c1804a8cde11fbabe535691 | [
"MIT"
] | null | null | null | product = input()
if product == "banana" or product == "apple" or product == "kiwi" or product == "cherry" or product == "lemon" or product == "grapes":
print("fruit")
elif product == "tomato" or product == "cucumber" or product == "pepper" or product == "carrot":
print("vegetable")
else:
print("unknown")
| 39.875 | 134 | 0.633229 | product = input()
if product == "banana" or product == "apple" or product == "kiwi" or product == "cherry" or product == "lemon" or product == "grapes":
print("fruit")
elif product == "tomato" or product == "cucumber" or product == "pepper" or product == "carrot":
print("vegetable")
else:
print("unknown")
| true | true |
f7f1b9632ce2351002d856d671c29617f42308f6 | 1,605 | py | Python | Symmetric/GCM-mode/forbidden-attack/server.py | killua4564/Symmetric | 183ea2ec1d1342e9124e710a2de0fcad8b399f3d | [
"MIT"
] | 1 | 2021-05-05T14:03:10.000Z | 2021-05-05T14:03:10.000Z | Symmetric/GCM-mode/forbidden-attack/server.py | killua4564/Symmetric | 183ea2ec1d1342e9124e710a2de0fcad8b399f3d | [
"MIT"
] | null | null | null | Symmetric/GCM-mode/forbidden-attack/server.py | killua4564/Symmetric | 183ea2ec1d1342e9124e710a2de0fcad8b399f3d | [
"MIT"
] | null | null | null | import os
import sys
from Crypto.Cipher import AES
from secret import FLAG
iv = os.urandom(16)
key = os.urandom(32)
auth = os.urandom(16)
def encrypt():
plaintext = input('Input a string to encrypt: ')
if len(plaintext) < len(FLAG[0]):
sys.exit(1)
cipher = AES.new(key, AES.MODE_GCM, nonce=iv).upd... | 29.722222 | 104 | 0.598754 | import os
import sys
from Crypto.Cipher import AES
from secret import FLAG
iv = os.urandom(16)
key = os.urandom(32)
auth = os.urandom(16)
def encrypt():
plaintext = input('Input a string to encrypt: ')
if len(plaintext) < len(FLAG[0]):
sys.exit(1)
cipher = AES.new(key, AES.MODE_GCM, nonce=iv).upd... | true | true |
f7f1b98014f7cd5f0dc9e5daa8005336963e4b7a | 1,008 | py | Python | app.py | LazyBanker/robinhood-resiliant-trader | 551026f1e25610e5b0efb66438fabcb10101ab18 | [
"MIT"
] | 10 | 2018-01-25T18:58:00.000Z | 2022-02-28T21:17:35.000Z | app.py | stepbot/resiliant-trader | 551026f1e25610e5b0efb66438fabcb10101ab18 | [
"MIT"
] | null | null | null | app.py | stepbot/resiliant-trader | 551026f1e25610e5b0efb66438fabcb10101ab18 | [
"MIT"
] | null | null | null | from flask import Flask, request, render_template, session, flash, redirect, \
url_for, jsonify, make_response
app = Flask(__name__)
@app.route('/')
def index():
import datetime
import io
import random
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotl... | 25.2 | 79 | 0.678571 | from flask import Flask, request, render_template, session, flash, redirect, \
url_for, jsonify, make_response
app = Flask(__name__)
@app.route('/')
def index():
import datetime
import io
import random
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotl... | true | true |
f7f1bae7aabcae71d81a27291b43582ba773309a | 314 | py | Python | libsoft/book/urls.py | akhil4rajan/library_management | 3c8031ba6c8237c26358097005f60cd57b8a0c3f | [
"MIT"
] | null | null | null | libsoft/book/urls.py | akhil4rajan/library_management | 3c8031ba6c8237c26358097005f60cd57b8a0c3f | [
"MIT"
] | null | null | null | libsoft/book/urls.py | akhil4rajan/library_management | 3c8031ba6c8237c26358097005f60cd57b8a0c3f | [
"MIT"
] | null | null | null | from django.urls import path
from .views import BookListView, BookCreateAPIView, BookDetailView, TotalBookView
urlpatterns = [
path('', BookListView.as_view()),
path('add/', BookCreateAPIView.as_view()),
path('<int:pk>/', BookDetailView.as_view()),
path('total_books/', TotalBookView.as_view())
]
| 31.4 | 81 | 0.716561 | from django.urls import path
from .views import BookListView, BookCreateAPIView, BookDetailView, TotalBookView
urlpatterns = [
path('', BookListView.as_view()),
path('add/', BookCreateAPIView.as_view()),
path('<int:pk>/', BookDetailView.as_view()),
path('total_books/', TotalBookView.as_view())
]
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.