hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73037a5f0c5b05174b9618464d1cd001011645b | 6,765 | py | Python | dm_pix/_src/metrics.py | mbilalai/dm_pix | 458e86f28df3f72017dc00b5449bc9ede3e0f566 | [
"Apache-2.0"
] | 1 | 2021-07-29T06:51:21.000Z | 2021-07-29T06:51:21.000Z | dm_pix/_src/metrics.py | mbilalai/dm_pix | 458e86f28df3f72017dc00b5449bc9ede3e0f566 | [
"Apache-2.0"
] | null | null | null | dm_pix/_src/metrics.py | mbilalai/dm_pix | 458e86f28df3f72017dc00b5449bc9ede3e0f566 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 DeepMind Technologies Limited. 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 ... | 31.910377 | 80 | 0.660902 |
import chex
import jax
import jax.numpy as jnp
import jax.scipy as jsp
def mae(a: chex.Array, b: chex.Array) -> chex.Numeric:
chex.assert_rank([a, b], {3, 4})
chex.assert_type([a, b], float)
chex.assert_equal_shape([a, b])
return jnp.abs(a - b).mean(axis=(-3, -2, -1))
def mse(a: chex.Array, b: chex.Array) ... | true | true |
f7303a247f463ef73a520434699ce478c010e0a7 | 416 | py | Python | receitas/migrations/0005_receita_foto_receita.py | maldonadopereira/django-receitas | 72a2215abacf5e8076b57b34ebf36211a8f0afb2 | [
"MIT"
] | null | null | null | receitas/migrations/0005_receita_foto_receita.py | maldonadopereira/django-receitas | 72a2215abacf5e8076b57b34ebf36211a8f0afb2 | [
"MIT"
] | null | null | null | receitas/migrations/0005_receita_foto_receita.py | maldonadopereira/django-receitas | 72a2215abacf5e8076b57b34ebf36211a8f0afb2 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-20 01:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('receitas', '0004_receita_publicar'),
]
operations = [
migrations.AddField(
model_name='receita',
name='foto_receita'... | 21.894737 | 76 | 0.600962 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('receitas', '0004_receita_publicar'),
]
operations = [
migrations.AddField(
model_name='receita',
name='foto_receita',
field=models.ImageField(blank=True... | true | true |
f7303adbd62fce274698448d9c9ef1a6103caf71 | 11,555 | py | Python | jupyter_kernel_test/msgspec_v5.py | IsraelMiles/jupyter_kernel_test | 369cf22e505820d910aaf50cdbbb6b3f51766a63 | [
"BSD-3-Clause"
] | 57 | 2015-08-04T15:45:45.000Z | 2022-02-03T23:14:31.000Z | jupyter_kernel_test/msgspec_v5.py | IsraelMiles/jupyter_kernel_test | 369cf22e505820d910aaf50cdbbb6b3f51766a63 | [
"BSD-3-Clause"
] | 55 | 2015-07-02T17:55:05.000Z | 2021-12-30T19:05:40.000Z | jupyter_kernel_test/msgspec_v5.py | IsraelMiles/jupyter_kernel_test | 369cf22e505820d910aaf50cdbbb6b3f51766a63 | [
"BSD-3-Clause"
] | 34 | 2015-07-02T17:20:43.000Z | 2022-03-28T22:25:05.000Z | """Message schemas for message spec version 5"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from jsonschema import Draft4Validator, ValidationError
import re
protocol_version = (5, 1)
# These fragments will be wrapped in the boilerplate for a valid JSON sche... | 34.186391 | 91 | 0.590134 |
from jsonschema import Draft4Validator, ValidationError
import re
protocol_version = (5, 1)
schema_fragments = {}
def get_msg_content_validator(msg_type, version_minor):
frag = schema_fragments[msg_type]
schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "{} mes... | true | true |
f7303b21e2e3db21c47520be7c83cb2644cc4758 | 466 | py | Python | env/Lib/site-packages/plotly/validators/scattercarpet/marker/colorbar/_xpad.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/scattercarpet/marker/colorbar/_xpad.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/scattercarpet/marker/colorbar/_xpad.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class XpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="xpad", parent_name="scattercarpet.marker.colorbar", **kwargs
):
super(XpadValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | 31.066667 | 87 | 0.641631 | import _plotly_utils.basevalidators
class XpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="xpad", parent_name="scattercarpet.marker.colorbar", **kwargs
):
super(XpadValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | true | true |
f7303bca22e1ac8527afeffd1d88492df41a22c8 | 1,874 | py | Python | Sources/ospboard/opt/osp/share/scripts/system_check.py | nihospr01/OpenSpeechPlatform | 799fb5baa5b8cdfad0f5387dd48b394adc583ede | [
"BSD-2-Clause"
] | null | null | null | Sources/ospboard/opt/osp/share/scripts/system_check.py | nihospr01/OpenSpeechPlatform | 799fb5baa5b8cdfad0f5387dd48b394adc583ede | [
"BSD-2-Clause"
] | null | null | null | Sources/ospboard/opt/osp/share/scripts/system_check.py | nihospr01/OpenSpeechPlatform | 799fb5baa5b8cdfad0f5387dd48b394adc583ede | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import sys
import time
import datetime
import os
import psutil
def main():
CurrentTime = datetime.datetime.now()
with open(r"/sys/class/thermal/thermal_zone0/temp") as f:
CurrentTemp0 = f.readline()
with open(r"/sys/class/thermal/thermal_zone1/temp") as f:
Cur... | 30.225806 | 133 | 0.577375 |
import sys
import time
import datetime
import os
import psutil
def main():
CurrentTime = datetime.datetime.now()
with open(r"/sys/class/thermal/thermal_zone0/temp") as f:
CurrentTemp0 = f.readline()
with open(r"/sys/class/thermal/thermal_zone1/temp") as f:
CurrentTemp1 = f.readline(... | true | true |
f7303bebd882517201c20381d045a17ff877a40a | 6,044 | py | Python | passengerCOVIDscan/glove_detection/tensorflow_infer.py | pradip026/passengerCOVIDscan | 1ebbe23beb91963679a97d8e9fe45354c47bbbff | [
"MIT"
] | null | null | null | passengerCOVIDscan/glove_detection/tensorflow_infer.py | pradip026/passengerCOVIDscan | 1ebbe23beb91963679a97d8e9fe45354c47bbbff | [
"MIT"
] | null | null | null | passengerCOVIDscan/glove_detection/tensorflow_infer.py | pradip026/passengerCOVIDscan | 1ebbe23beb91963679a97d8e9fe45354c47bbbff | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import cv2
import time
import argparse
import os
import numpy as np
from PIL import Image
#from keras.models import model_from_json
from .utils.anchor_generator import generate_anchors
from .utils.anchor_decode import decode_bbox
from .utils.nms import single_class_non_max_suppression
from .load_... | 40.293333 | 115 | 0.603739 | import cv2
import time
import argparse
import os
import numpy as np
from PIL import Image
from .utils.anchor_generator import generate_anchors
from .utils.anchor_decode import decode_bbox
from .utils.nms import single_class_non_max_suppression
from .load_model.tensorflow_loader import load_tf_model, tf_inference
MODEL... | true | true |
f7303c0eda96006944c2233d97ba5ca90c986d6f | 2,295 | py | Python | benchresults/rankselect/bitsize_table.py | pacman616/hybrid-fenwick-tree | 84e7cc8aa84b87937b98d85f3c2ed1998c0d79af | [
"MIT"
] | 4 | 2019-01-10T17:55:43.000Z | 2019-11-26T09:33:38.000Z | benchresults/rankselect/bitsize_table.py | pacman616/hybrid-fenwick-tree | 84e7cc8aa84b87937b98d85f3c2ed1998c0d79af | [
"MIT"
] | null | null | null | benchresults/rankselect/bitsize_table.py | pacman616/hybrid-fenwick-tree | 84e7cc8aa84b87937b98d85f3c2ed1998c0d79af | [
"MIT"
] | null | null | null | from collections import OrderedDict
# Data from: benchresults/rankselect/data/rankselect_nohugetlb/bitsize.csv
# Numbers to LaTeX regex: :s/\([0-9]\.?[0-9]*\)\([,\" ]\)/$\1$\2/g
lbls = "Elements,fixed[F],fixed[$\ell$],byte[F],byte[$\ell$],bit[F],bit[$\ell$],fixed[$16$]fixed,byte[$16$]byte,bit[$16$]bit,fixed[$16$]byte... | 91.8 | 977 | 0.639216 | from collections import OrderedDict
lbls = "Elements,fixed[F],fixed[$\ell$],byte[F],byte[$\ell$],bit[F],bit[$\ell$],fixed[$16$]fixed,byte[$16$]byte,bit[$16$]bit,fixed[$16$]byte,fixed[$16$]bit,byte[$16$]bit,fixed[F]$8$,fixed[$\ell$]$8$,byte[F]$8$,byte[$\ell$]$8$,bit[F]$8$,bit[$\ell$]$8$,fixed[$16$]fixed$8$,byte[$16$]b... | true | true |
f7303cda043ce962a43ddaf990831db987ed128f | 758 | py | Python | manage.py | Boring-Mind/sbc-store | d16cce07bcb05ff2ea901411a5129ab1f0540161 | [
"MIT"
] | null | null | null | manage.py | Boring-Mind/sbc-store | d16cce07bcb05ff2ea901411a5129ab1f0540161 | [
"MIT"
] | null | null | null | manage.py | Boring-Mind/sbc-store | d16cce07bcb05ff2ea901411a5129ab1f0540161 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
from store.settings.base import get_config_type
def main():
# Set path to the current config file
os.environ.setdefault(
'DJANGO_SETTINGS_MODULE',
'store.settings.' + get_config_type()
... | 28.074074 | 73 | 0.675462 | import os
import sys
from store.settings.base import get_config_type
def main():
os.environ.setdefault(
'DJANGO_SETTINGS_MODULE',
'store.settings.' + get_config_type()
)
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rai... | true | true |
f7303e3fc37e9d2b3d1733a2847b96c9ba7bc3e0 | 7,086 | py | Python | ansible/modules/network/avi/avi_sslprofile.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/network/avi/avi_sslprofile.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ansible/modules/network/avi/avi_sslprofile.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 16.3.8
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | 35.787879 | 136 | 0.673299 |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: avi_sslprofile
author: Gaurav Rastogi (grastogi@avinetworks.com)
short_description: Module for setup of SSLProfile Avi RESTful Object
description... | true | true |
f7303fe1c7865651a322e4e2df538947ebd447f6 | 6,503 | py | Python | zerver/webhooks/sonarr/view.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zerver/webhooks/sonarr/view.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/sonarr/view.py | dumpmemory/zulip | 496273ddbc567330a0022699d6d6eb5c646e5da5 | [
"Apache-2.0"
] | 1 | 2022-02-04T05:15:12.000Z | 2022-02-04T05:15:12.000Z | from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common ... | 40.899371 | 182 | 0.721974 | from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventType
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common ... | true | true |
f730429da94736b9ecf8b387b5667497fa6dec89 | 132 | py | Python | GA_tsp_optimisation/__init__.py | JessikaSmith/OptimizationAlgorithms | bf0f871f4d6150e1e7533360cfc6f70eb616c870 | [
"MIT"
] | 15 | 2018-11-16T04:42:44.000Z | 2020-03-20T16:00:47.000Z | GA_tsp_optimisation/__init__.py | JessikaSmith/OptimizationAlgorithms | bf0f871f4d6150e1e7533360cfc6f70eb616c870 | [
"MIT"
] | null | null | null | GA_tsp_optimisation/__init__.py | JessikaSmith/OptimizationAlgorithms | bf0f871f4d6150e1e7533360cfc6f70eb616c870 | [
"MIT"
] | 3 | 2019-01-17T13:18:56.000Z | 2019-12-17T22:22:48.000Z | from .mutation import Mutation
from .crossover import Crossover
from .selection import Selector
from .ga_pipeline import ga_pipeline | 33 | 36 | 0.856061 | from .mutation import Mutation
from .crossover import Crossover
from .selection import Selector
from .ga_pipeline import ga_pipeline | true | true |
f730429fdfa6612d800f5277781da67e08805140 | 204 | py | Python | libs/VulnScan.py | glaudsonml/kurgan-ai | c0ad4450f9fb2004f35b8a0201bfe894e01adc8f | [
"Apache-2.0"
] | 35 | 2017-05-22T14:42:01.000Z | 2020-09-07T21:24:41.000Z | libs/VulnScan.py | tmaxter/kurgan-ai | c0ad4450f9fb2004f35b8a0201bfe894e01adc8f | [
"Apache-2.0"
] | null | null | null | libs/VulnScan.py | tmaxter/kurgan-ai | c0ad4450f9fb2004f35b8a0201bfe894e01adc8f | [
"Apache-2.0"
] | 5 | 2017-12-19T03:36:54.000Z | 2021-04-14T18:05:08.000Z | '''
Vulnerability Scanner Class
'''
class VulnScan(object):
scanning=True
def set_scanning(self, val):
self.scanning = val
def get_scanning(self):
return self.scanning
| 14.571429 | 32 | 0.637255 |
class VulnScan(object):
scanning=True
def set_scanning(self, val):
self.scanning = val
def get_scanning(self):
return self.scanning
| true | true |
f730431b27e07083dae8b1e4b35faa1a13906b39 | 2,221 | py | Python | generated-libraries/python/netapp/coredump/coredump_config_modify_iter_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/coredump/coredump_config_modify_iter_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/coredump/coredump_config_modify_iter_info.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.coredump.coredump_config_info import CoredumpConfigInfo
from netapp.netapp_object import NetAppObject
class CoredumpConfigModifyIterInfo(NetAppObject):
"""
Information about the modify operation that was
attempted/performed against coredump-config object.
were not modified due to some error... | 30.424658 | 109 | 0.61729 | from netapp.coredump.coredump_config_info import CoredumpConfigInfo
from netapp.netapp_object import NetAppObject
class CoredumpConfigModifyIterInfo(NetAppObject):
_error_code = None
@property
def error_code(self):
return self._error_code
@error_code.setter
def error_code(self, val):
... | true | true |
f730433703f39fdd32cf073d91c160a604ea19a7 | 1,983 | py | Python | recipes/recipe_modules/depot_tools/api.py | xiayongtao/depot_tools | 02e6133a844e47dd55159a585144708bae11b76d | [
"BSD-3-Clause"
] | null | null | null | recipes/recipe_modules/depot_tools/api.py | xiayongtao/depot_tools | 02e6133a844e47dd55159a585144708bae11b76d | [
"BSD-3-Clause"
] | null | null | null | recipes/recipe_modules/depot_tools/api.py | xiayongtao/depot_tools | 02e6133a844e47dd55159a585144708bae11b76d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 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.
"""The `depot_tools` module provides safe functions to access paths within
the depot_tools repo."""
import contextlib
from recipe_engine import recipe_api
... | 25.753247 | 74 | 0.702975 |
import contextlib
from recipe_engine import recipe_api
class DepotToolsApi(recipe_api.RecipeApi):
@property
def download_from_google_storage_path(self):
return self.repo_resource('download_from_google_storage.py')
@property
def upload_to_google_storage_path(self):
return self.repo_resource('upload_... | true | true |
f730440cb51639d90c3a94b3a0f7db56fd17a3c5 | 5,151 | py | Python | PaddleSlim/classification/pruning/compress.py | XiaoguangHu01/models | a95d49323ed504e5a9164586f171f408954fd43a | [
"Apache-2.0"
] | null | null | null | PaddleSlim/classification/pruning/compress.py | XiaoguangHu01/models | a95d49323ed504e5a9164586f171f408954fd43a | [
"Apache-2.0"
] | null | null | null | PaddleSlim/classification/pruning/compress.py | XiaoguangHu01/models | a95d49323ed504e5a9164586f171f408954fd43a | [
"Apache-2.0"
] | null | null | null | import os
import sys
import logging
import paddle
import argparse
import functools
import math
import paddle.fluid as fluid
sys.path.append("..")
import imagenet_reader as reader
import models
sys.path.append("../../")
from utility import add_arguments, print_arguments
from paddle.fluid.contrib.slim import Compressor
... | 39.623077 | 108 | 0.673461 | import os
import sys
import logging
import paddle
import argparse
import functools
import math
import paddle.fluid as fluid
sys.path.append("..")
import imagenet_reader as reader
import models
sys.path.append("../../")
from utility import add_arguments, print_arguments
from paddle.fluid.contrib.slim import Compressor
... | true | true |
f730443cb35af115bf5129a4cd48778f2a808e00 | 150 | py | Python | uploading/apps.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | uploading/apps.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | uploading/apps.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class UploadingConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'uploading'
| 21.428571 | 56 | 0.766667 | from django.apps import AppConfig
class UploadingConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'uploading'
| true | true |
f73045076a374efc7d1d0f523aa322cd6ee1a0de | 470 | py | Python | tests/RigTests/bob_guide_build.py | FabricExile/Kraken | d8c1f5189cb191945e2c18a1369c458d05305afc | [
"BSD-3-Clause"
] | 7 | 2017-12-04T16:57:42.000Z | 2021-09-07T07:02:38.000Z | tests/RigTests/bob_guide_build.py | xtvjxk123456/Kraken | d8c1f5189cb191945e2c18a1369c458d05305afc | [
"BSD-3-Clause"
] | null | null | null | tests/RigTests/bob_guide_build.py | xtvjxk123456/Kraken | d8c1f5189cb191945e2c18a1369c458d05305afc | [
"BSD-3-Clause"
] | 6 | 2017-11-14T06:50:48.000Z | 2021-08-21T22:47:29.000Z | import json
from kraken import plugins
from kraken_examples.bob_guide import BobGuide
from kraken.core.profiler import Profiler
from kraken.helpers.utility_methods import logHierarchy
Profiler.getInstance().push("bob_guide_build")
bobGuide = BobGuide("char_bob_guide")
builder = plugins.getBuilder()
builder.build(b... | 21.363636 | 55 | 0.797872 | import json
from kraken import plugins
from kraken_examples.bob_guide import BobGuide
from kraken.core.profiler import Profiler
from kraken.helpers.utility_methods import logHierarchy
Profiler.getInstance().push("bob_guide_build")
bobGuide = BobGuide("char_bob_guide")
builder = plugins.getBuilder()
builder.build(b... | false | true |
f730464f2c13d32a8c07491ab4bcbeb1a2f56555 | 11,607 | py | Python | HPC/pandayoda/yodaexe/Droid.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | HPC/pandayoda/yodaexe/Droid.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | HPC/pandayoda/yodaexe/Droid.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | import commands
import json
import os
import shutil
import sys
import time
import pickle
import signal
from os.path import abspath as _abspath, join as _join
from pandayoda.yodacore import Interaction,Database,Logger
from EventServer.EventServerJobManager import EventServerJobManager
class Droid:
def __init__(sel... | 44.814672 | 139 | 0.593177 | import commands
import json
import os
import shutil
import sys
import time
import pickle
import signal
from os.path import abspath as _abspath, join as _join
from pandayoda.yodacore import Interaction,Database,Logger
from EventServer.EventServerJobManager import EventServerJobManager
class Droid:
def __init__(sel... | false | true |
f73046cc8c22aa50dfd3a3b28c9591b12f1c2237 | 2,457 | py | Python | tests/configs/realview64-o3-checker.py | ronaldof1s1/gem5 | 418ac1d9ab21049f6d21476bc66f08467c29a9e3 | [
"BSD-3-Clause"
] | 135 | 2016-10-21T03:31:49.000Z | 2022-03-25T01:22:20.000Z | tests/configs/realview64-o3-checker.py | akeley98/FU-pools | dcd47b7dad279246093081cab24b95cae363c3b3 | [
"BSD-3-Clause"
] | 35 | 2017-03-10T17:57:46.000Z | 2022-02-18T17:34:16.000Z | tests/configs/realview64-o3-checker.py | akeley98/FU-pools | dcd47b7dad279246093081cab24b95cae363c3b3 | [
"BSD-3-Clause"
] | 48 | 2016-12-08T12:03:13.000Z | 2022-02-16T09:16:13.000Z | # Copyright (c) 2012, 2017, 2019 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the fu... | 53.413043 | 72 | 0.764754 |
from m5.objects import *
from arm_generic import *
from common.cores.arm.O3_ARM_v7a import O3_ARM_v7a_3
root = LinuxArmFSSystemUniprocessor(mem_mode='timing',
mem_class=DDR3_1600_8x8,
cpu_class=O3_ARM_v7a_3,
ch... | true | true |
f73047495463637b196d2d01ac086770b021da5f | 274 | py | Python | edamino/logger.py | drevenzz/aminoCAT | 48c4de0da0c830a0550fdee7fb8499645c434e90 | [
"MIT"
] | null | null | null | edamino/logger.py | drevenzz/aminoCAT | 48c4de0da0c830a0550fdee7fb8499645c434e90 | [
"MIT"
] | null | null | null | edamino/logger.py | drevenzz/aminoCAT | 48c4de0da0c830a0550fdee7fb8499645c434e90 | [
"MIT"
] | null | null | null | import logging
__all__ = ['logger']
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
fmt = logging.Formatter(fmt="%(levelname)s: %(message)s")
handler.setFormatter(fmt)
handler.setLevel(logging.INFO)
logger.addHandler(handler)
| 21.076923 | 57 | 0.770073 | import logging
__all__ = ['logger']
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
fmt = logging.Formatter(fmt="%(levelname)s: %(message)s")
handler.setFormatter(fmt)
handler.setLevel(logging.INFO)
logger.addHandler(handler)
| true | true |
f7304753312193a3300eef211e2e820629c26beb | 745 | py | Python | Python/ex49.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | 1 | 2022-02-01T17:59:50.000Z | 2022-02-01T17:59:50.000Z | Python/ex49.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | null | null | null | Python/ex49.py | Anderson0312/Python | 1fd225378c55309640d584a4894393f7c40dc9ed | [
"MIT"
] | null | null | null | numeros = list()
for n in range(0, 5):
numeros.append(int(input(f'Digite um valor para a posição {n}: ')))
print(f'Voce digitou os valores {numeros}')
print('O maior valor digitado foi {} nas possições'.format(max(numeros)), end=' ')
'''
No for
O pos foi usado para fixar a localização
o v foi usado para fixar os v... | 29.8 | 84 | 0.660403 | numeros = list()
for n in range(0, 5):
numeros.append(int(input(f'Digite um valor para a posição {n}: ')))
print(f'Voce digitou os valores {numeros}')
print('O maior valor digitado foi {} nas possições'.format(max(numeros)), end=' ')
for pos, v in enumerate(numeros):
if v == max(numeros):
print(f'{pos... | true | true |
f73047624b50599b4347a4f861a06e86d3173252 | 3,865 | py | Python | database.py | techx/evolution-chamber | dea9b7d563df6f06d270078f5c512e3f7e367a92 | [
"MIT"
] | 4 | 2015-06-22T15:44:57.000Z | 2015-06-22T15:57:03.000Z | database.py | techx/evolution-chamber | dea9b7d563df6f06d270078f5c512e3f7e367a92 | [
"MIT"
] | null | null | null | database.py | techx/evolution-chamber | dea9b7d563df6f06d270078f5c512e3f7e367a92 | [
"MIT"
] | 2 | 2015-07-09T15:21:37.000Z | 2016-02-02T15:59:09.000Z | import sqlite3
from flask import g, Flask
from constants import Constants
import json
DATABASE = 'db/sqlite.db'
app = Flask(Constants.APP_NAME)
def get_db():
db = getattr(g, '_database', None)
if db is None:
db = g._database = sqlite3.connect(DATABASE)
return db
@app.teardown_appcontext
def clos... | 33.318966 | 132 | 0.636999 | import sqlite3
from flask import g, Flask
from constants import Constants
import json
DATABASE = 'db/sqlite.db'
app = Flask(Constants.APP_NAME)
def get_db():
db = getattr(g, '_database', None)
if db is None:
db = g._database = sqlite3.connect(DATABASE)
return db
@app.teardown_appcontext
def clos... | true | true |
f730492b5e3c2fa866c5ccaab58e6a2dbe382054 | 2,222 | py | Python | cirq-core/cirq/devices/device_test.py | dabacon/Cirq | 54286063f679d67501ff1b905cd16b879feaae27 | [
"Apache-2.0"
] | 1 | 2021-04-29T15:30:32.000Z | 2021-04-29T15:30:32.000Z | cirq-core/cirq/devices/device_test.py | dabacon/Cirq | 54286063f679d67501ff1b905cd16b879feaae27 | [
"Apache-2.0"
] | 1 | 2020-04-03T20:23:20.000Z | 2020-04-03T20:23:20.000Z | cirq-core/cirq/devices/device_test.py | dabacon/Cirq | 54286063f679d67501ff1b905cd16b879feaae27 | [
"Apache-2.0"
] | 2 | 2021-09-22T11:16:46.000Z | 2021-09-23T12:55:22.000Z | # pylint: disable=wrong-or-nonexistent-copyright-notice
import pytest
import cirq
def test_qubit_set():
class RawDevice(cirq.Device):
pass
assert RawDevice().qubit_set() is None
class QubitFieldDevice(cirq.Device):
def __init__(self):
self.qubits = cirq.LineQubit.range(3)
... | 28.487179 | 96 | 0.654815 | import pytest
import cirq
def test_qubit_set():
class RawDevice(cirq.Device):
pass
assert RawDevice().qubit_set() is None
class QubitFieldDevice(cirq.Device):
def __init__(self):
self.qubits = cirq.LineQubit.range(3)
assert QubitFieldDevice().qubit_set() == frozenset(cir... | true | true |
f7304932a03b54e012707f27c70ff5f74726299a | 1,481 | py | Python | contributions/statistics.py | t170815518/contributions-graph | 7a3c3477afaa578789bdbfb41554f267d89f1ace | [
"MIT"
] | 106 | 2015-09-15T04:53:24.000Z | 2022-01-25T22:11:56.000Z | contributions/statistics.py | t170815518/contributions-graph | 7a3c3477afaa578789bdbfb41554f267d89f1ace | [
"MIT"
] | 2 | 2017-05-03T09:27:24.000Z | 2017-09-14T06:49:42.000Z | contributions/statistics.py | t170815518/contributions-graph | 7a3c3477afaa578789bdbfb41554f267d89f1ace | [
"MIT"
] | 22 | 2016-07-25T06:54:06.000Z | 2021-10-15T00:25:56.000Z | #!/usr/bin/env python
import dateutils
def quartiles(values):
"""
Returns the (rough) quintlines of a series of values. This is not intended
to be statistically correct - it's not a quick 'n' dirty measure.
"""
return [i * max(values) / 4 for i in range(5)]
def longest_streak(dates):
"""
... | 27.425926 | 78 | 0.656313 |
import dateutils
def quartiles(values):
return [i * max(values) / 4 for i in range(5)]
def longest_streak(dates):
if not dates:
return []
dates = sorted(dates)
streaks = []
current_streak = [dates[0]]
for idx in range(1, len(dates)):
date = dates[idx]
if dateut... | true | true |
f730495e98e013a7ae5f3395303f9cca988c62f0 | 439 | py | Python | aoc2020/day_03/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_03/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_03/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
class Solution(SolutionABC):
expected = 7
def solve(self) -> any:
x, rt, rows = 0, 0, self.resource_lines("input")
try:
# Discard the first row
next(rows)
while True:
row = next(rows)
x = (x + 3) % len(... | 21.95 | 56 | 0.43508 | from aoc2020 import *
class Solution(SolutionABC):
expected = 7
def solve(self) -> any:
x, rt, rows = 0, 0, self.resource_lines("input")
try:
next(rows)
while True:
row = next(rows)
x = (x + 3) % len(row)
if ... | true | true |
f73049b42798b7cba68acbf111d74dde4a7db3b6 | 1,642 | py | Python | clock/contact/forms.py | chgad/django-clock | f855cd1253574c0582ed53a0ac34206c242f04c9 | [
"MIT"
] | null | null | null | clock/contact/forms.py | chgad/django-clock | f855cd1253574c0582ed53a0ac34206c242f04c9 | [
"MIT"
] | null | null | null | clock/contact/forms.py | chgad/django-clock | f855cd1253574c0582ed53a0ac34206c242f04c9 | [
"MIT"
] | 1 | 2020-03-13T14:42:11.000Z | 2020-03-13T14:42:11.000Z | # -*- coding: utf-8 -*-
from captcha.fields import ReCaptchaField
from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.http import Http... | 38.186047 | 96 | 0.708892 | from captcha.fields import ReCaptchaField
from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.http import HttpResponseRedirect
from dj... | true | true |
f73049e4bd6fa9b18eb2403dd15770e56954fa20 | 1,420 | py | Python | ggplot/geoms/__init__.py | briandk/ggplot | 179bc1bb61501bbfa8aaa7ef2d0a25150c8863dd | [
"BSD-2-Clause"
] | null | null | null | ggplot/geoms/__init__.py | briandk/ggplot | 179bc1bb61501bbfa8aaa7ef2d0a25150c8863dd | [
"BSD-2-Clause"
] | null | null | null | ggplot/geoms/__init__.py | briandk/ggplot | 179bc1bb61501bbfa8aaa7ef2d0a25150c8863dd | [
"BSD-2-Clause"
] | 1 | 2020-11-14T13:31:11.000Z | 2020-11-14T13:31:11.000Z | from __future__ import (absolute_import, division, print_function,
unicode_literals)
# geoms
from .geom_abline import geom_abline
from .geom_area import geom_area
from .geom_bar import geom_bar
from .geom_density import geom_density
from .geom_histogram import geom_histogram
from .geom_hline imp... | 38.378378 | 73 | 0.762676 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .geom_abline import geom_abline
from .geom_area import geom_area
from .geom_bar import geom_bar
from .geom_density import geom_density
from .geom_histogram import geom_histogram
from .geom_hline import geom... | true | true |
f7304c8702cd45f0614fd6d7a10b566c1f7152f7 | 8,043 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/tlvprofile/defaulttlv_8e41257d3d01ec013783dd0fd6697862.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/tlvprofile/defaulttlv_8e41257d3d01ec013783dd0fd6697862.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/tlvprofile/defaulttlv_8e41257d3d01ec013783dd0fd6697862.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"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, ... | 38.668269 | 165 | 0.652617 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class DefaultTlv(Base):
__slots__ = ()
_SDM_NAME = 'defaultTlv'
_SDM_ATT_MAP = {
'AvailableIncludeInMessages': 'availableIncludeInMessages',
'Description': 'description',
'EnablePerSession':... | true | true |
f7304dbc9e1394e220698ba5c8e2752e04b4528b | 5,563 | py | Python | sources/ebf-demo/scripts/test/imu.py | zwg0106/imx-yocto | e378ca25352a59d1ef84ee95f3386b7314f4565b | [
"MIT"
] | 1 | 2020-01-13T13:16:52.000Z | 2020-01-13T13:16:52.000Z | sources/ebf-demo/scripts/test/imu.py | zwg0106/imx-yocto | e378ca25352a59d1ef84ee95f3386b7314f4565b | [
"MIT"
] | 3 | 2019-11-20T02:53:01.000Z | 2019-12-26T03:00:15.000Z | sources/ebf-demo/scripts/test/imu.py | zwg0106/imx-yocto | e378ca25352a59d1ef84ee95f3386b7314f4565b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pygame
from OpenGL.GL import *
from OpenGL.GLU import *
import socket
import json
from pygame.locals import *
SCREEN_SIZE = (800, 600)
address = ('', 5000)
def resize(width, height):
glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity... | 27.815 | 113 | 0.472047 |
import pygame
from OpenGL.GL import *
from OpenGL.GLU import *
import socket
import json
from pygame.locals import *
SCREEN_SIZE = (800, 600)
address = ('', 5000)
def resize(width, height):
glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(45... | true | true |
f7304e9d38fb2af01ffb1db1e0e42104960448d1 | 13,856 | py | Python | fox/connection.py | piger/fox | d411189e5eba9eafb334a059853a9af6ea52ba06 | [
"BSD-2-Clause"
] | 6 | 2019-04-23T16:10:40.000Z | 2021-11-17T10:18:25.000Z | fox/connection.py | piger/fox | d411189e5eba9eafb334a059853a9af6ea52ba06 | [
"BSD-2-Clause"
] | null | null | null | fox/connection.py | piger/fox | d411189e5eba9eafb334a059853a9af6ea52ba06 | [
"BSD-2-Clause"
] | null | null | null | import os
import shlex
import getpass
import warnings
import asyncio
import logging
import collections
import atexit
from typing import Optional, Dict, Deque
import tqdm
import asyncssh
from .conf import env, options_to_connect
from .utils import run_in_loop, CommandResult, prepare_environment, split_lines
# disable ... | 33.795122 | 100 | 0.608978 | import os
import shlex
import getpass
import warnings
import asyncio
import logging
import collections
import atexit
from typing import Optional, Dict, Deque
import tqdm
import asyncssh
from .conf import env, options_to_connect
from .utils import run_in_loop, CommandResult, prepare_environment, split_lines
warnings.s... | true | true |
f7304f72fe5aeb256f1ab7cc3f24471399e0baaf | 6,041 | py | Python | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py | hortonworks/ambari-perf | 71305effa9ac00e2e9adb36e6a66a13c9105a811 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-05-06T06:24:04.000Z | 2021-05-06T06:24:04.000Z | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py | gcxtx/ambari | 133d9c4661b21182482c25f96c3f0bf0a9740a9f | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py | gcxtx/ambari | 133d9c4661b21182482c25f96c3f0bf0a9740a9f | [
"Apache-2.0"
] | 3 | 2017-10-31T11:42:31.000Z | 2021-04-26T07:17:53.000Z | #!/usr/bin/env python
"""
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");... | 36.173653 | 134 | 0.691442 | """
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 use this ... | false | true |
f7304f89593d1379710d96a3531d54d1dcff8680 | 733 | py | Python | tests/test_toboday.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | 50 | 2021-08-18T08:08:04.000Z | 2022-03-20T07:23:26.000Z | tests/test_toboday.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | 1 | 2021-02-21T03:18:09.000Z | 2021-03-08T01:07:52.000Z | tests/test_toboday.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | 8 | 2021-07-01T02:39:15.000Z | 2021-12-10T02:20:18.000Z | from __future__ import annotations
from datetime import date, datetime
from unittest import TestCase
from tests.classes.super_datetime import SuperDateTime
class TestToboday(TestCase):
def test_toboday_transforms_datetime_into_the_time_of_beginning_of_day(self):
d = SuperDateTime(dtbd=datetime(2021, 10,... | 34.904762 | 81 | 0.747613 | from __future__ import annotations
from datetime import date, datetime
from unittest import TestCase
from tests.classes.super_datetime import SuperDateTime
class TestToboday(TestCase):
def test_toboday_transforms_datetime_into_the_time_of_beginning_of_day(self):
d = SuperDateTime(dtbd=datetime(2021, 10,... | true | true |
f7305096c852a5bd53317118877b8128c82fd818 | 20,647 | py | Python | web/datasets/migrations/0011_auto_20200515_1115.py | RaulBSantos/maria-quiteria | 9eb1a307099e208ce666bcc0d65be9c9a4cae150 | [
"MIT"
] | 151 | 2019-11-10T02:18:25.000Z | 2022-01-18T14:28:25.000Z | web/datasets/migrations/0011_auto_20200515_1115.py | RaulBSantos/maria-quiteria | 9eb1a307099e208ce666bcc0d65be9c9a4cae150 | [
"MIT"
] | 202 | 2019-11-09T16:27:19.000Z | 2022-03-22T12:41:27.000Z | web/datasets/migrations/0011_auto_20200515_1115.py | RaulBSantos/maria-quiteria | 9eb1a307099e208ce666bcc0d65be9c9a4cae150 | [
"MIT"
] | 69 | 2020-02-05T01:33:35.000Z | 2022-03-30T10:39:27.000Z | # Generated by Django 2.2.12 on 2020-05-15 14:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("datasets", "0010_auto_20200515_0959"),
]
operations = [
migrations.AlterField(
model_name="citycouncilagenda",
name... | 36.350352 | 88 | 0.539885 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("datasets", "0010_auto_20200515_0959"),
]
operations = [
migrations.AlterField(
model_name="citycouncilagenda",
name="crawled_at",
field=models.DateTimeF... | true | true |
f73051c3feff91789b9c7364b801010e5c39b0e2 | 149 | py | Python | 13-python-integration/1-python-introduction/hello.py | tehilabk/cpp-5781 | 736ed05dddb2a7270bbcdbb04a3ffb4b9046e358 | [
"MIT"
] | 14 | 2021-01-30T16:36:18.000Z | 2022-03-30T17:24:44.000Z | 13-python-integration/1-python-introduction/hello.py | dimastar2310/cpp-5781 | 615ba07e0841522df74384f380172557f5e305a7 | [
"MIT"
] | null | null | null | 13-python-integration/1-python-introduction/hello.py | dimastar2310/cpp-5781 | 615ba07e0841522df74384f380172557f5e305a7 | [
"MIT"
] | 23 | 2020-03-12T13:21:29.000Z | 2021-02-22T21:29:48.000Z | #!python3
# single-line string:
print("hello")
# multi-line strings:
print("""
w
o
r
l
d
"""
)
print("abc"*3)
a = [1,2,3,4]
print(a*3)
| 7.45 | 21 | 0.536913 |
print("hello")
print("""
w
o
r
l
d
"""
)
print("abc"*3)
a = [1,2,3,4]
print(a*3)
| true | true |
f7305317714c65d2ae52341ae5236b5e05b703e3 | 703 | py | Python | main.py | benayas1/FastAPI-demo | 9f242acf499a4f896ac7102d0c301c90d11acb2e | [
"MIT"
] | null | null | null | main.py | benayas1/FastAPI-demo | 9f242acf499a4f896ac7102d0c301c90d11acb2e | [
"MIT"
] | null | null | null | main.py | benayas1/FastAPI-demo | 9f242acf499a4f896ac7102d0c301c90d11acb2e | [
"MIT"
] | null | null | null | from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from src.build_model import convert, predict
app = FastAPI()
# pydantic models
class StockIn(BaseModel):
ticker: str
class StockOut(StockIn):
forecast: dict
# routes
@app.get("/ping")
async def pong():
return {"ping": "pon... | 18.5 | 78 | 0.721195 | from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from src.build_model import convert, predict
app = FastAPI()
class StockIn(BaseModel):
ticker: str
class StockOut(StockIn):
forecast: dict
@app.get("/ping")
async def pong():
return {"ping": "pong!"}
@app.post("/predict"... | true | true |
f730535cc3c8c3715aaee00884ba41ed22be7ce5 | 8,550 | py | Python | cinder/volume/drivers/open_e/jovian_common/rest_proxy.py | shubhamdang/cinder | 03a8ca07d5710771c597fd92de50103313ec7f76 | [
"Apache-2.0"
] | 3 | 2016-08-23T20:37:47.000Z | 2016-10-12T11:16:35.000Z | cinder/volume/drivers/open_e/jovian_common/rest_proxy.py | shubhamdang/cinder | 03a8ca07d5710771c597fd92de50103313ec7f76 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/open_e/jovian_common/rest_proxy.py | shubhamdang/cinder | 03a8ca07d5710771c597fd92de50103313ec7f76 | [
"Apache-2.0"
] | 1 | 2019-09-25T11:15:01.000Z | 2019-09-25T11:15:01.000Z | # Copyright (c) 2020 Open-E, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 37.665198 | 79 | 0.491579 |
import json
import time
from oslo_log import log as logging
from oslo_utils import netutils as o_netutils
import requests
import urllib3
from cinder import exception
from cinder.i18n import _
from cinder.volume.drivers.open_e.jovian_common import exception as jexc
LOG = logging.getLogger(__name__)
class JovianR... | true | true |
f73053fd0a165b1b4054dc4e1336ef1364710f9d | 2,296 | py | Python | Experiments/ST_MGCN/deprecated/didi_trial.py | TempAnonymous/Context_Analysis | bbeba1ed7ea7001c22a12721fc4f390d4cc01a6e | [
"MIT"
] | 28 | 2020-02-28T03:16:43.000Z | 2022-03-31T07:24:47.000Z | Experiments/ST_MGCN/deprecated/didi_trial.py | TempAnonymous/Context_Analysis | bbeba1ed7ea7001c22a12721fc4f390d4cc01a6e | [
"MIT"
] | 8 | 2020-06-30T09:34:56.000Z | 2022-01-17T12:20:28.000Z | Experiments/ST_MGCN/deprecated/didi_trial.py | TempAnonymous/Context_Analysis | bbeba1ed7ea7001c22a12721fc4f390d4cc01a6e | [
"MIT"
] | 13 | 2020-06-04T09:47:36.000Z | 2022-02-25T09:50:52.000Z | import os
import warnings
warnings.filterwarnings("ignore")
shared_params_st_mgcn = ('python ST_MGCN_Obj.py '
'--Dataset DiDi '
'--CT 6 '
'--PT 7 '
'--TT 4 '
'--LSTMUnits 64 '
... | 45.019608 | 98 | 0.434669 | import os
import warnings
warnings.filterwarnings("ignore")
shared_params_st_mgcn = ('python ST_MGCN_Obj.py '
'--Dataset DiDi '
'--CT 6 '
'--PT 7 '
'--TT 4 '
'--LSTMUnits 64 '
... | true | true |
f73054605f8bd8b1ec1a6f2b7c0863270a33ba11 | 1,022 | py | Python | setup.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | setup.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | setup.py | TaruniSurampally/testpatrolev | 7c7fe1cad2967e0be84ca74b9a200ae2fde356db | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 ATT Corporation.
# 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 la... | 32.967742 | 69 | 0.749511 |
import setuptools
try:
import multiprocessing except ImportError:
pass
setuptools.setup(
setup_requires=['pbr>=1.8'],
pbr=True)
| true | true |
f73055f4dfa87a425c2bda83e8e320add863b887 | 490 | py | Python | backend/src/myCU_App/migrations/0001_initial.py | citz73/myCUProject | afad36d6cf072e44d4707860496a023053d34789 | [
"MIT"
] | 1 | 2020-03-15T04:27:30.000Z | 2020-03-15T04:27:30.000Z | backend/src/myCU_App/migrations/0001_initial.py | citz73/myCUSide_Project | afad36d6cf072e44d4707860496a023053d34789 | [
"MIT"
] | null | null | null | backend/src/myCU_App/migrations/0001_initial.py | citz73/myCUSide_Project | afad36d6cf072e44d4707860496a023053d34789 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2020-03-01 01:09
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='MyModelTest',
fields=[
('id', models.AutoFi... | 22.272727 | 114 | 0.577551 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='MyModelTest',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, seriali... | true | true |
f73056d77fb654514f04a7ff33b8c84ed4722dee | 1,732 | py | Python | data_postprocessing_10.py | KokBob/InitProject | 63b7cefb9a130118db9ff5405c5dd87bbe34e9f3 | [
"BSD-2-Clause"
] | null | null | null | data_postprocessing_10.py | KokBob/InitProject | 63b7cefb9a130118db9ff5405c5dd87bbe34e9f3 | [
"BSD-2-Clause"
] | null | null | null | data_postprocessing_10.py | KokBob/InitProject | 63b7cefb9a130118db9ff5405c5dd87bbe34e9f3 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
20181010
ciklaminima
"""
import numpy as np
import matplotlib.pyplot as plt
import os
import pandas as pd
import _dataPostprLib_ as lib
import seaborn as sns
import importlib
#%%
sns.set()
#sns.set_context("poster")
sns.set_context("paper")
#sns.color_palette("Paired")
seq... | 28.866667 | 83 | 0.646074 | import numpy as np
import matplotlib.pyplot as plt
import os
import pandas as pd
import _dataPostprLib_ as lib
import seaborn as sns
import importlib
sns.set()
sns.set_context("paper")
seq_col_brew = sns.color_palette('hls', 12)
sns.set_palette(seq_col_brew)
plt.close('all')
path_glob = r'U:\projects\00... | true | true |
f73057eeee7582782ed1d122e1834de489b95405 | 698 | py | Python | github_stats/cli.py | mrlesmithjr/python-github-stats | 5e9237b8caf372b1b0cb791e593f8209f1d19204 | [
"MIT"
] | null | null | null | github_stats/cli.py | mrlesmithjr/python-github-stats | 5e9237b8caf372b1b0cb791e593f8209f1d19204 | [
"MIT"
] | 6 | 2021-04-23T12:45:04.000Z | 2021-08-08T01:07:41.000Z | github_stats/cli.py | mrlesmithjr/python-github-stats | 5e9237b8caf372b1b0cb791e593f8209f1d19204 | [
"MIT"
] | null | null | null | """Console script for python-github-stats."""
import argparse
import os
def cli_args():
"""Parse CLI arguments."""
parser = argparse.ArgumentParser(description="Manage GitHub via API.")
parser.add_argument(
"action", help="Define action to take.", choices=["user-attrs", "user-repos"]
)
... | 24.068966 | 85 | 0.627507 |
import argparse
import os
def cli_args():
parser = argparse.ArgumentParser(description="Manage GitHub via API.")
parser.add_argument(
"action", help="Define action to take.", choices=["user-attrs", "user-repos"]
)
parser.add_argument(
"--netrcfile",
help="Path to Netrc file... | true | true |
f730580ba95c7eaadd448112b44a1b8b774609d7 | 1,012 | py | Python | application.py | WengChaoxi/flask-mvc | 250a0c5811745f674b45e39262bc81c92756ce0c | [
"MIT"
] | 1 | 2020-10-25T15:15:01.000Z | 2020-10-25T15:15:01.000Z | application.py | WengChaoxi/flask-mvc | 250a0c5811745f674b45e39262bc81c92756ce0c | [
"MIT"
] | null | null | null | application.py | WengChaoxi/flask-mvc | 250a0c5811745f674b45e39262bc81c92756ce0c | [
"MIT"
] | null | null | null | # coding: utf-8
from flask import Flask as FlaskBase
from flask_sqlalchemy import SQLAlchemy
from flask_apscheduler import APScheduler
import os
from jobs.tasks.timer import SchedulerConfig
from common.libs.utils import correctPath
db = SQLAlchemy()
scheduler = APScheduler() # 定时任务
class Flask(FlaskBase):
def __i... | 33.733333 | 131 | 0.759881 | from flask import Flask as FlaskBase
from flask_sqlalchemy import SQLAlchemy
from flask_apscheduler import APScheduler
import os
from jobs.tasks.timer import SchedulerConfig
from common.libs.utils import correctPath
db = SQLAlchemy()
scheduler = APScheduler()
class Flask(FlaskBase):
def __init__(self, import_name... | true | true |
f73058b87fae3279f8d290c4759bd446c990a5a0 | 437 | py | Python | app/model/tables.py | fabiomvieira/users-flask | 3e57c673b51e2f1cbb6f32a70ddd2c90cd86c1cb | [
"MIT"
] | null | null | null | app/model/tables.py | fabiomvieira/users-flask | 3e57c673b51e2f1cbb6f32a70ddd2c90cd86c1cb | [
"MIT"
] | null | null | null | app/model/tables.py | fabiomvieira/users-flask | 3e57c673b51e2f1cbb6f32a70ddd2c90cd86c1cb | [
"MIT"
] | null | null | null | from app import app, db
class User(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, autoincrement = True, primary_key = True)
name = db.Column(db.String(100))
age = db.Column(db.Integer)
email = db.Column(db.String(30))
phone = db.Column(db.Integer)
def __init__(self, name, age... | 29.133333 | 72 | 0.622426 | from app import app, db
class User(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, autoincrement = True, primary_key = True)
name = db.Column(db.String(100))
age = db.Column(db.Integer)
email = db.Column(db.String(30))
phone = db.Column(db.Integer)
def __init__(self, name, age... | true | true |
f7305921f05bca4dc553d0619e616ffdbebb8450 | 7,712 | py | Python | Prototype/template.py | TalaatHarb/PredictOceanHealth | 998717a8b6eab59dbedd7b9ffdd86a05b03ec079 | [
"MIT"
] | null | null | null | Prototype/template.py | TalaatHarb/PredictOceanHealth | 998717a8b6eab59dbedd7b9ffdd86a05b03ec079 | [
"MIT"
] | null | null | null | Prototype/template.py | TalaatHarb/PredictOceanHealth | 998717a8b6eab59dbedd7b9ffdd86a05b03ec079 | [
"MIT"
] | null | null | null | #Import libraries for doing image analysis
from skimage.io import imread
from skimage.transform import resize
from sklearn.ensemble import RandomForestClassifier as RF
import glob
import os
from sklearn import cross_validation
from sklearn.cross_validation import StratifiedKFold as KFold
from sklearn.metrics import cla... | 36.549763 | 108 | 0.678683 | from skimage.io import imread
from skimage.transform import resize
from sklearn.ensemble import RandomForestClassifier as RF
import glob
import os
from sklearn import cross_validation
from sklearn.cross_validation import StratifiedKFold as KFold
from sklearn.metrics import classification_report
from matplotlib import p... | false | true |
f7305a0dbb2a8aae8064a95ec3fa52386dab4833 | 37,699 | py | Python | website/venv/lib/python2.7/site-packages/psutil/tests/test_misc.py | wenhuiyang/ARgot | 3fd1eacca6f81a3157649dda95ab427ca1f5efe1 | [
"MIT"
] | 2 | 2017-11-24T12:44:30.000Z | 2020-04-11T17:28:43.000Z | psutil/tests/test_misc.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 6 | 2017-11-10T19:45:18.000Z | 2017-11-12T14:50:42.000Z | psutil/tests/test_misc.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Miscellaneous tests.
"""
import ast
import collections
import contextlib
import errno
import json
impor... | 36.353905 | 79 | 0.577257 |
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ast
import collections
import contextlib
import errno
import json
import os
import pickle
import socket
import stat
import sys
from psutil import LINUX
from psutil import POSIX
from psutil import WINDOWS
fro... | true | true |
f7305a7160e771c29930fa09a63b5a4213102df1 | 2,604 | py | Python | PyDictAPI/__init__.py | imshawan/PyDictAPI | 937001ce896b634132e6dce3e0f1a59986c4551c | [
"MIT"
] | null | null | null | PyDictAPI/__init__.py | imshawan/PyDictAPI | 937001ce896b634132e6dce3e0f1a59986c4551c | [
"MIT"
] | null | null | null | PyDictAPI/__init__.py | imshawan/PyDictAPI | 937001ce896b634132e6dce3e0f1a59986c4551c | [
"MIT"
] | 1 | 2021-08-29T11:08:07.000Z | 2021-08-29T11:08:07.000Z |
"""
----------------------
Python Dictionary API
----------------------
PyDictAPI is library written in Python, that can be used to fetch meanings and translation.
Both the Finder and Translator class takes an arguement "jsonify" that is set to False by default.
If jsonify is set to True, than the processed querie... | 30.635294 | 231 | 0.656682 |
__author__ = "Shawan Mandal"
__email__ = "imshawan.dev049@gmail.com"
__version__ = "1.6.0"
try:
from .scrape import *
from .translator import *
except:
from scrape import *
from translator import *
| true | true |
f7305a74ccf623557222c020c2382bc476227606 | 3,177 | py | Python | tests/e2e_scenarios.py | rneatherway/CCF | e04c6bbbe0b5ba044abaab9f972287194b6fc6cc | [
"Apache-2.0"
] | 2 | 2020-08-06T04:12:36.000Z | 2021-09-09T04:15:25.000Z | tests/e2e_scenarios.py | rajdhandus/CCF | 96edbc9db6bd14c559a8c59bcda1c2a4835768d2 | [
"Apache-2.0"
] | 2 | 2022-02-03T06:32:47.000Z | 2022-02-09T23:00:07.000Z | tests/e2e_scenarios.py | securelogicgroup/CCF | 2bad8ca6caa146e6b7cd4167fea551d61fecabfa | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import os
import json
import http
import random
import infra.network
import infra.proc
import infra.e2e_args
import infra.checker
from loguru import logger as LOG
def run(args):
# SNIPPET_START: parsing
with ... | 32.418367 | 81 | 0.514951 | import os
import json
import http
import random
import infra.network
import infra.proc
import infra.e2e_args
import infra.checker
from loguru import logger as LOG
def run(args):
with open(args.scenario) as f:
scenario = json.load(f)
hosts = scenario.get("hosts", infra.e2e_args.max_nodes(args, f=... | true | true |
f7305b4091d94994c4a20cc3634347522a8f0bce | 35,217 | py | Python | qiskit/visualization/pulse/matplotlib.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/visualization/pulse/matplotlib.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | null | null | null | qiskit/visualization/pulse/matplotlib.py | siddharthdangwal/qiskit-terra | af34eb06f28de18ef276e1e9029c62a4e35dd6a9 | [
"Apache-2.0"
] | 1 | 2020-07-13T17:56:46.000Z | 2020-07-13T17:56:46.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 39.13 | 96 | 0.548911 |
import collections
import warnings
from typing import Dict, List, Tuple, Callable, Union, Any
import numpy as np
try:
from matplotlib import pyplot as plt, gridspec
HAS_MATPLOTLIB = True
except ImportError:
HAS_MATPLOTLIB = False
from qiskit.visualization.pulse.qcstyle import PulseStyle, SchedStyle
f... | true | true |
f7305d3f7c5dd7b9094f0a20b4e9f5a957e94535 | 1,443 | py | Python | numpylint/lintbits.py | perimosocordiae/numpylint | 67e6c077b393760bffe59524ede1d4904476a1ce | [
"MIT"
] | null | null | null | numpylint/lintbits.py | perimosocordiae/numpylint | 67e6c077b393760bffe59524ede1d4904476a1ce | [
"MIT"
] | null | null | null | numpylint/lintbits.py | perimosocordiae/numpylint | 67e6c077b393760bffe59524ede1d4904476a1ce | [
"MIT"
] | null | null | null | import numpy as np
# Dict of all the patterns with their replacements.
# Structure:
# name of replacement -> list of (pattern, replacement, kwargs) tuples
LINTBITS = {
'diagonal matrix dot product': [
# diag(x).dot(y)
('${diag}(${x}).dot(${y})', '((${x}) * (${y}).T).T',
dict(diag='name=... | 35.195122 | 72 | 0.444213 | import numpy as np
LINTBITS = {
'diagonal matrix dot product': [
('${diag}(${x}).dot(${y})', '((${x}) * (${y}).T).T',
dict(diag='name=numpy.diag')),
('${dot}(${diag}(${x}), ${y})', '((${x}) * (${y}).T).T',
dict(diag='name=numpy.diag', dot='name=numpy.dot')),
... | true | true |
f7305eb7c580daac5db72b2c4ac0c1258330b442 | 26,460 | py | Python | bert4keras/snippets.py | vecent-don/bert4keras | 3c31cbbf87d6574ddad038e4ea17a941ddd027dc | [
"Apache-2.0"
] | 1 | 2021-06-03T12:39:23.000Z | 2021-06-03T12:39:23.000Z | bert4keras/snippets.py | vecent-don/bert4keras | 3c31cbbf87d6574ddad038e4ea17a941ddd027dc | [
"Apache-2.0"
] | null | null | null | bert4keras/snippets.py | vecent-don/bert4keras | 3c31cbbf87d6574ddad038e4ea17a941ddd027dc | [
"Apache-2.0"
] | null | null | null | #! -*- coding: utf-8 -*-
# 代码合集
import os, sys, six, re, json
import logging
import numpy as np
from collections import defaultdict
from bert4keras.backend import K, keras, tf
_open_ = open
is_py2 = six.PY2
if not is_py2:
basestring = str
def to_array(*args):
"""批量转numpy的array
"""
results = [np.arr... | 30.875146 | 80 | 0.524339 |
import os, sys, six, re, json
import logging
import numpy as np
from collections import defaultdict
from bert4keras.backend import K, keras, tf
_open_ = open
is_py2 = six.PY2
if not is_py2:
basestring = str
def to_array(*args):
results = [np.array(a) for a in args]
if len(args) == 1:
return res... | true | true |
f7305f172f99aa4ee10baf90adde0cdb5a91636b | 432 | py | Python | altair/examples/__init__.py | jakevdp/altair2 | 46d391034c5b72867c9e4d01f3a7c7c536533add | [
"BSD-3-Clause"
] | 2 | 2018-02-03T05:35:52.000Z | 2018-02-05T21:00:18.000Z | altair/examples/__init__.py | jakevdp/altair2 | 46d391034c5b72867c9e4d01f3a7c7c536533add | [
"BSD-3-Clause"
] | null | null | null | altair/examples/__init__.py | jakevdp/altair2 | 46d391034c5b72867c9e4d01f3a7c7c536533add | [
"BSD-3-Clause"
] | null | null | null | import os
import json
def iter_example_names():
specdir = os.path.join(os.path.dirname(__file__), 'spec')
for spec in sorted(os.listdir(specdir)):
yield spec
def load_example(name):
filename = os.path.join(os.path.dirname(__file__), 'spec', name)
with open(filename, 'r') as f:
return... | 21.6 | 68 | 0.671296 | import os
import json
def iter_example_names():
specdir = os.path.join(os.path.dirname(__file__), 'spec')
for spec in sorted(os.listdir(specdir)):
yield spec
def load_example(name):
filename = os.path.join(os.path.dirname(__file__), 'spec', name)
with open(filename, 'r') as f:
return... | true | true |
f7305ff6dcb783b887e7c18ac02bfe8c87cfeacf | 112 | py | Python | vl/wsgi.py | verifid/vl | 39fb3056658fbc2360eb3d8bfcd74bdcfd12cc67 | [
"MIT"
] | 3 | 2019-06-30T21:09:05.000Z | 2021-05-09T17:56:19.000Z | vl/wsgi.py | verifid/vl | 39fb3056658fbc2360eb3d8bfcd74bdcfd12cc67 | [
"MIT"
] | null | null | null | vl/wsgi.py | verifid/vl | 39fb3056658fbc2360eb3d8bfcd74bdcfd12cc67 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from vl.app import app as application
if __name__ == "__main__":
application.run()
| 16 | 37 | 0.705357 |
from vl.app import app as application
if __name__ == "__main__":
application.run()
| true | true |
f73060075d4c066e5e8285761903993ce0cf2935 | 31,110 | py | Python | pymatgen/core/composition.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | 1 | 2015-05-18T14:31:20.000Z | 2015-05-18T14:31:20.000Z | pymatgen/core/composition.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | null | null | null | pymatgen/core/composition.py | rousseab/pymatgen | ecfba4a576a21f31c222be8fd20ce2ddaa77495a | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import division, unicode_literals
"""
This module implements a Composition class to represent compositions,
and a ChemicalPotential class to represent potentials.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer... | 36.006944 | 80 | 0.564899 |
from __future__ import division, unicode_literals
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__status__ = "Production"
__date__ = "Nov 10, 2012"
import collections
import numbers
import re... | true | true |
f730609d863d7ec81eadcaed88ab2c70b888fad3 | 22,602 | py | Python | GearGenerator_by_UI.py | manguel1980-dev/Gear-Generator | c4f2eea957340201e42a213b458cc1c28d04833b | [
"MIT"
] | null | null | null | GearGenerator_by_UI.py | manguel1980-dev/Gear-Generator | c4f2eea957340201e42a213b458cc1c28d04833b | [
"MIT"
] | null | null | null | GearGenerator_by_UI.py | manguel1980-dev/Gear-Generator | c4f2eea957340201e42a213b458cc1c28d04833b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------------
# Name: Gear Generator
# Purpose: Just for fun
#
# Author: Manuel Astros
# Email: manuel.astros1980@gmail.com
# Web: https://sites.google.com/view/interpolation/home
#
# C... | 44.756436 | 160 | 0.543713 |
import sys
from PyQt5.uic import loadUi
from PyQt5 import QtWidgets, QtCore
from PyQt5.QtGui import QCloseEvent, QFont
from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QHeaderView, \
QCheckBox, QComboBox, QMessageBox, QWidget, QVBoxLayout
from Gear_Mpl_Draw impor... | true | true |
f730617f1ec79e7ee02ce125d82a1b33d9acb7f8 | 4,003 | py | Python | workflow/powerbiCatToM.py | sixtysecondrevit/dynamoPython | dfb4b001800ebf9ab308510db40cfc5a5a953fee | [
"MIT"
] | 114 | 2018-07-17T17:47:11.000Z | 2022-03-08T09:33:39.000Z | workflow/powerbiCatToM.py | sixtysecondrevit/dynamoPython | dfb4b001800ebf9ab308510db40cfc5a5a953fee | [
"MIT"
] | 28 | 2018-07-18T10:43:37.000Z | 2020-11-24T06:08:18.000Z | workflow/powerbiCatToM.py | sixtysecondrevit/dynamoPython | dfb4b001800ebf9ab308510db40cfc5a5a953fee | [
"MIT"
] | 56 | 2018-07-17T17:57:28.000Z | 2022-03-26T12:30:39.000Z | '''
CATEGORIES TO M SCRIPT - CREATE CONDITIONAL STATEMENT CODE FOR POWER BI
-
a dynamoPython script, visit the website for more details
https://github.com/Amoursol/dynamoPython
'''
__author__ = 'Adam Bear - adam@ukbear.com'
__twitter__ = '@adambear82'
__github__ = '@adambear82'
__version__ = '1.0.0'
'''
for large proj... | 29.433824 | 154 | 0.683987 | __author__ = 'Adam Bear - adam@ukbear.com'
__twitter__ = '@adambear82'
__github__ = '@adambear82'
__version__ = '1.0.0'
import clr
clr.AddReference('System.Windows.Forms')
from System.Windows.Forms import Clipboard
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import Document... | true | true |
f730625ed1d40a9135df52e51742c9f032d3ce20 | 1,930 | py | Python | results/rabi_and_lmg_optimizations_20190227/script_rabi_bangramp_neldermead.py | lucainnocenti/ultrafast-critical-ground-state-preparation-2007.07381 | 29f80dcf914096555cee9bc2e18249a2c95d6a50 | [
"MIT"
] | 1 | 2020-07-21T02:31:41.000Z | 2020-07-21T02:31:41.000Z | results/rabi_and_lmg_optimizations_20190228/script_rabi_bangramp_neldermead.py | lucainnocenti/ultrafast-critical-ground-state-preparation-2007.07381 | 29f80dcf914096555cee9bc2e18249a2c95d6a50 | [
"MIT"
] | null | null | null | results/rabi_and_lmg_optimizations_20190228/script_rabi_bangramp_neldermead.py | lucainnocenti/ultrafast-critical-ground-state-preparation-2007.07381 | 29f80dcf914096555cee9bc2e18249a2c95d6a50 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
import pandas as pd
import logging
if '../../' not in sys.path:
sys.path.append('../../')
import src.optimization as optimization
model = 'rabi'
model_parameters = dict(N=100, Omega=100, omega_0=1.)
protocol = 'bangramp'
optimization_method = 'Nelder-Mead'
# ------ build... | 29.242424 | 70 | 0.707254 | import os
import sys
import numpy as np
import pandas as pd
import logging
if '../../' not in sys.path:
sys.path.append('../../')
import src.optimization as optimization
model = 'rabi'
model_parameters = dict(N=100, Omega=100, omega_0=1.)
protocol = 'bangramp'
optimization_method = 'Nelder-Mead'
additional_fil... | true | true |
f730640adaf31ffe5b7c8de73e4fd29b5bc4983e | 9,252 | py | Python | doc/source/conf.py | ifxit/nidho | 7d49bb7d879d0f3d444df50f2c18c2cdf883216c | [
"MIT"
] | 11 | 2016-06-09T12:07:14.000Z | 2018-01-18T08:01:08.000Z | doc/source/conf.py | ifxit/nidho | 7d49bb7d879d0f3d444df50f2c18c2cdf883216c | [
"MIT"
] | 4 | 2016-07-06T11:06:34.000Z | 2020-01-02T10:11:48.000Z | doc/source/conf.py | ifxit/nidhogg | 7d49bb7d879d0f3d444df50f2c18c2cdf883216c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Nidhogg documentation build configuration file, created by
# sphinx-quickstart on Thu May 28 09:48:45 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | 32.236934 | 79 | 0.718223 |
import os
import shlex
import sys
sys.path.insert(0, os.path.abspath('../../'))
extensions = [
'sphinx.ext.autodoc',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Nidhogg'
copyright = u'2018, Roland Wohlfahrt, Christian Assing'
author = u'Roland Wohlfahrt, Chris... | true | true |
f730647bf68842c5a3eff14c987502a2fca1c432 | 141,522 | py | Python | scripts/automation/trex_control_plane/interactive/trex/stl/trex_stl_client.py | GabrielGanne/trex-core | 688a0fe0adb890964691473723d70ffa98e00dd3 | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/interactive/trex/stl/trex_stl_client.py | GabrielGanne/trex-core | 688a0fe0adb890964691473723d70ffa98e00dd3 | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/interactive/trex/stl/trex_stl_client.py | GabrielGanne/trex-core | 688a0fe0adb890964691473723d70ffa98e00dd3 | [
"Apache-2.0"
] | null | null | null | import time
import sys
import os
from collections import OrderedDict
from functools import wraps
from ..utils.common import get_current_user, list_intersect, is_sub_list, user_input, list_difference, parse_ports_from_profiles
from ..utils import parsing_opts, text_tables
from ..utils.text_opts import format_text, form... | 39.268036 | 360 | 0.531084 | import time
import sys
import os
from collections import OrderedDict
from functools import wraps
from ..utils.common import get_current_user, list_intersect, is_sub_list, user_input, list_difference, parse_ports_from_profiles
from ..utils import parsing_opts, text_tables
from ..utils.text_opts import format_text, form... | true | true |
f73064bf0edcae1e29ce194797909ff6107a9759 | 22,176 | py | Python | salt/runners/saltutil.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 2 | 2015-06-18T19:07:20.000Z | 2017-09-27T18:54:29.000Z | salt/runners/saltutil.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-04-15T22:17:42.000Z | 2016-03-22T08:46:27.000Z | salt/runners/saltutil.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 4 | 2015-04-16T03:24:08.000Z | 2015-04-22T15:33:28.000Z | # -*- coding: utf-8 -*-
'''
The Saltutil runner is used to sync custom types to the Master. See the
:mod:`saltutil module <salt.modules.saltutil>` for documentation on
managing updates to minions.
.. versionadded:: 2016.3.0
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python l... | 33.498489 | 128 | 0.689123 | from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.utils.extmods
log = logging.getLogger(__name__)
def sync_all(saltenv='base', extmod_whitelist=None, extmod_blacklist=None):
log.debug('Syncing all')
ret = {}
ret['clouds'] = sync_clouds(saltenv=saltenv, ... | true | true |
f73064f7b7a9daf8dccd16ffa7b8b4d1a6869ec6 | 21,364 | py | Python | tensorflow/python/tpu/device_assignment.py | wainshine/tensorflow | dc7a8dc8546c679b9c7b3df7494ce4506bfc1a6d | [
"Apache-2.0"
] | 54 | 2017-06-17T14:07:48.000Z | 2022-03-29T02:11:20.000Z | tensorflow/python/tpu/device_assignment.py | wainshine/tensorflow | dc7a8dc8546c679b9c7b3df7494ce4506bfc1a6d | [
"Apache-2.0"
] | 19 | 2021-12-28T12:44:55.000Z | 2022-01-13T08:11:28.000Z | tensorflow/python/tpu/device_assignment.py | wainshine/tensorflow | dc7a8dc8546c679b9c7b3df7494ce4506bfc1a6d | [
"Apache-2.0"
] | 11 | 2018-04-19T22:36:01.000Z | 2021-08-02T08:44:43.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.15 | 99 | 0.662236 |
import enum
import math
from typing import List, Optional, Text, Tuple
import numpy as np
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.tpu.topology import Topology
from tensorflow.python.util.tf_export import tf_export
SINGLE_CORE_ASSIGNMENT = [[[0, 0, 0, 0]]]
def _compute_... | true | true |
f730660ea29c7c979e17a2993b7cf5dd2dd52d57 | 7,981 | py | Python | tests/unit/streamalert/alert_processor/outputs/test_output_base.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | tests/unit/streamalert/alert_processor/outputs/test_output_base.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | tests/unit/streamalert/alert_processor/outputs/test_output_base.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-present Airbnb, 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, sof... | 36.610092 | 96 | 0.699035 | from mock import Mock, patch, MagicMock
from moto import mock_kms, mock_ssm
from nose.tools import (
assert_equal,
assert_is_instance,
assert_is_not_none,
assert_is_none,
assert_count_equal
)
from requests.exceptions import Timeout as ReqTimeout
from streamalert.alert_processor.outputs.output_base ... | true | true |
f7306785f709b39146aac848874a28763d800c0c | 20,872 | py | Python | test/functional/test_framework/script.py | bitcoin-money/bitcoinmoney | d208756366292fa7ab16b8f4b9f2dff9b8567bee | [
"MIT"
] | null | null | null | test/functional/test_framework/script.py | bitcoin-money/bitcoinmoney | d208756366292fa7ab16b8f4b9f2dff9b8567bee | [
"MIT"
] | null | null | null | test/functional/test_framework/script.py | bitcoin-money/bitcoinmoney | d208756366292fa7ab16b8f4b9f2dff9b8567bee | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Money developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as SignatureHash().
This file is modified from python-bitcoin... | 30.118326 | 146 | 0.613549 |
from .mininode import CTransaction, CTxOut, sha256, hash256, uint256_from_str, ser_uint256, ser_string
from binascii import hexlify
import hashlib
import sys
bchr = chr
bord = ord
if sys.version > '3':
long = int
bchr = lambda x: bytes([x])
bord = lambda x: x
import struct
from .bignum import bn2vch
MA... | true | true |
f730697874d74284e3f36d2b3355caa3e355cf54 | 2,770 | py | Python | mwparserfromhell/nodes/wikilink.py | valhallasw/mwparserfromhell | 1607687c37c1b1e7c0c83a39d7803707665151ef | [
"MIT"
] | null | null | null | mwparserfromhell/nodes/wikilink.py | valhallasw/mwparserfromhell | 1607687c37c1b1e7c0c83a39d7803707665151ef | [
"MIT"
] | null | null | null | mwparserfromhell/nodes/wikilink.py | valhallasw/mwparserfromhell | 1607687c37c1b1e7c0c83a39d7803707665151ef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# 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 ... | 33.373494 | 79 | 0.654152 |
from __future__ import unicode_literals
from . import Node
from ..compat import str
from ..utils import parse_anything
__all__ = ["Wikilink"]
class Wikilink(Node):
def __init__(self, title, text=None):
super(Wikilink, self).__init__()
self._title = title
self._text = text
def __uni... | true | true |
f7306a7014d8a082178a163194f35de56aafd413 | 1,195 | py | Python | addons/log2report_csv.py | geoffrey0822/multilevellabel_NN | faec3303dac2376d6e8a761632aca31bc3868413 | [
"Apache-2.0"
] | null | null | null | addons/log2report_csv.py | geoffrey0822/multilevellabel_NN | faec3303dac2376d6e8a761632aca31bc3868413 | [
"Apache-2.0"
] | null | null | null | addons/log2report_csv.py | geoffrey0822/multilevellabel_NN | faec3303dac2376d6e8a761632aca31bc3868413 | [
"Apache-2.0"
] | null | null | null | import os,sys
import numpy as np
import csv
input_file=sys.argv[1]
output_file=sys.argv[2]
header='I0315'
if len(sys.argv)>3:
header=sys.argv[3]
keys=[]
epoch_data=[]
epoch_row=[]
with open(input_file,'r') as f:
for ln in f:
line=ln.rstrip('\n')
if line.startswith(header) and 'Test net output'... | 29.146341 | 65 | 0.543096 | import os,sys
import numpy as np
import csv
input_file=sys.argv[1]
output_file=sys.argv[2]
header='I0315'
if len(sys.argv)>3:
header=sys.argv[3]
keys=[]
epoch_data=[]
epoch_row=[]
with open(input_file,'r') as f:
for ln in f:
line=ln.rstrip('\n')
if line.startswith(header) and 'Test net output'... | false | true |
f7306a936639c0c25548020fae55cc2780443200 | 935 | py | Python | wus_feats_predict.py | FloodCamML/FloodCam-WUSFeats | b58c3f3770bebebf078be4e3804f12f3512b5569 | [
"MIT"
] | 2 | 2021-05-21T10:57:44.000Z | 2021-05-29T17:02:54.000Z | wus_feats_predict.py | FloodCamML/FloodCam-WUSFeats | b58c3f3770bebebf078be4e3804f12f3512b5569 | [
"MIT"
] | null | null | null | wus_feats_predict.py | FloodCamML/FloodCam-WUSFeats | b58c3f3770bebebf078be4e3804f12f3512b5569 | [
"MIT"
] | 1 | 2021-05-28T12:45:38.000Z | 2021-05-28T12:45:38.000Z |
#i/o
import requests, os, random
from glob import glob
from collections import Counter
from collections import defaultdict
from PIL import Image
from skimage.io import imread
import pickle
#numerica
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow import keras
from ten... | 29.21875 | 113 | 0.840642 |
import requests, os, random
from glob import glob
from collections import Counter
from collections import defaultdict
from PIL import Image
from skimage.io import imread
import pickle
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow import keras
from tensorflow.keras i... | true | true |
f7306be7655fa4665aa16310d89615d9df796e9f | 207 | py | Python | leetcode/python/others/hamming_distance.py | ajeet1308/code_problems | 5d99839b6319295c6d81dd86775c46a536e7a1ca | [
"MIT"
] | 61 | 2020-09-26T19:57:44.000Z | 2022-03-09T18:51:44.000Z | leetcode/python/others/hamming_distance.py | ajeet1308/code_problems | 5d99839b6319295c6d81dd86775c46a536e7a1ca | [
"MIT"
] | 88 | 2020-09-19T20:00:27.000Z | 2021-10-31T09:41:57.000Z | leetcode/python/others/hamming_distance.py | ajeet1308/code_problems | 5d99839b6319295c6d81dd86775c46a536e7a1ca | [
"MIT"
] | 218 | 2020-09-20T08:18:03.000Z | 2022-01-30T23:13:16.000Z | class Solution:
def hammingDistance(self, x: int, y: int) -> int:
count = 0
diff = x ^ y
while diff != 0:
count += 1
diff &= (diff-1)
return count
| 23 | 53 | 0.454106 | class Solution:
def hammingDistance(self, x: int, y: int) -> int:
count = 0
diff = x ^ y
while diff != 0:
count += 1
diff &= (diff-1)
return count
| true | true |
f7306cae98bbc792ae9e49ea47e2232347c28149 | 3,218 | py | Python | homeassistant/util/logging.py | GotoCode/home-assistant | 7e39a5c4d50cf5754f5f32a84870ca57a5778b02 | [
"Apache-2.0"
] | 11 | 2017-09-25T13:11:33.000Z | 2020-05-16T21:54:28.000Z | homeassistant/util/logging.py | GotoCode/home-assistant | 7e39a5c4d50cf5754f5f32a84870ca57a5778b02 | [
"Apache-2.0"
] | 125 | 2018-12-11T07:31:20.000Z | 2021-07-27T08:20:03.000Z | homeassistant/util/logging.py | y1ngyang/home-assistant | 7e39a5c4d50cf5754f5f32a84870ca57a5778b02 | [
"Apache-2.0"
] | 3 | 2018-05-22T18:52:01.000Z | 2019-07-18T21:30:45.000Z | """Logging utilities."""
import asyncio
import logging
import threading
from .async_ import run_coroutine_threadsafe
class HideSensitiveDataFilter(logging.Filter):
"""Filter API password calls."""
def __init__(self, text):
"""Initialize sensitive data filter."""
super().__init__()
se... | 26.377049 | 74 | 0.598198 | import asyncio
import logging
import threading
from .async_ import run_coroutine_threadsafe
class HideSensitiveDataFilter(logging.Filter):
def __init__(self, text):
super().__init__()
self.text = text
def filter(self, record):
record.msg = record.msg.replace(self.text, '*******')
... | true | true |
f7306e7cc53d34293df4261830687777126b1853 | 107,459 | py | Python | pysnmp-with-texts/HUAWEI-CLOCK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/HUAWEI-CLOCK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/HUAWEI-CLOCK-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 HUAWEI-CLOCK-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-CLOCK-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:43:52 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... | 148.629322 | 11,779 | 0.782587 | Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint = mibBuilder.impo... | true | true |
f7306fd1c3e0405e0d613485262300727fcf5a80 | 340 | py | Python | setup.py | ScottHMcKean/gfracture | 63eec9fd4cf4234149b6a6656ec538d5a6ddcb41 | [
"MIT"
] | null | null | null | setup.py | ScottHMcKean/gfracture | 63eec9fd4cf4234149b6a6656ec538d5a6ddcb41 | [
"MIT"
] | null | null | null | setup.py | ScottHMcKean/gfracture | 63eec9fd4cf4234149b6a6656ec538d5a6ddcb41 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='gfracture',
version='0.1',
description='Fracture segmentation and trace analysis',
url='https://github.com/ScottHMcKean/gfracture',
author='Scott McKean',
author_email='scott.mckean@ucalgary.ca',
license='MIT',
packages=['gfracture'],
... | 30.909091 | 61 | 0.667647 | from setuptools import setup
setup(name='gfracture',
version='0.1',
description='Fracture segmentation and trace analysis',
url='https://github.com/ScottHMcKean/gfracture',
author='Scott McKean',
author_email='scott.mckean@ucalgary.ca',
license='MIT',
packages=['gfracture'],
... | true | true |
f7307105658f4dd57c433ca83570b1d9ad3a1448 | 79 | py | Python | src/textacy/tokenizers/__init__.py | austinjp/textacy | dddfdbf0e0ab3bf756bc4eda042eab1001aac709 | [
"Apache-2.0"
] | 1,929 | 2016-02-14T08:30:38.000Z | 2022-03-31T03:00:35.000Z | src/textacy/tokenizers/__init__.py | austinjp/textacy | dddfdbf0e0ab3bf756bc4eda042eab1001aac709 | [
"Apache-2.0"
] | 304 | 2016-02-18T15:52:22.000Z | 2022-03-31T18:06:54.000Z | src/textacy/tokenizers/__init__.py | austinjp/textacy | dddfdbf0e0ab3bf756bc4eda042eab1001aac709 | [
"Apache-2.0"
] | 285 | 2016-03-20T04:25:08.000Z | 2022-03-24T11:31:17.000Z | from .char_ngrams import CharNgramsTokenizer
from .terms import TermsTokenizer
| 26.333333 | 44 | 0.873418 | from .char_ngrams import CharNgramsTokenizer
from .terms import TermsTokenizer
| true | true |
f73071c7b77b19c3949f7425141f76374ee2f03f | 1,667 | py | Python | selfswab/migrations/0012_auto_20201202_1235.py | praekeltfoundation/healthcheck | 3f8b3722ea41c2d81c706e0f9a3473ba2cb2f2ba | [
"BSD-3-Clause"
] | null | null | null | selfswab/migrations/0012_auto_20201202_1235.py | praekeltfoundation/healthcheck | 3f8b3722ea41c2d81c706e0f9a3473ba2cb2f2ba | [
"BSD-3-Clause"
] | 23 | 2020-07-16T15:40:35.000Z | 2021-12-13T13:59:30.000Z | selfswab/migrations/0012_auto_20201202_1235.py | praekeltfoundation/healthcheck | 3f8b3722ea41c2d81c706e0f9a3473ba2cb2f2ba | [
"BSD-3-Clause"
] | 1 | 2021-02-24T04:58:40.000Z | 2021-02-24T04:58:40.000Z | # Generated by Django 3.1 on 2020-12-02 10:35
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("selfswab", "0011_selfswabtest_should_sync"),
]
operations = [
migrations.AddField(
model_name="selfsw... | 28.741379 | 74 | 0.467307 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("selfswab", "0011_selfswabtest_should_sync"),
]
operations = [
migrations.AddField(
model_name="selfswabregistration",
name="age",
... | true | true |
f7307275427014a14072d16f4f9a637d0116fbc9 | 19,509 | py | Python | tests/unit/common/db/test_api.py | onecloud/gbp-rally | 7589b1788c4de26bb66c531ef340ba080754f8c3 | [
"Apache-2.0"
] | null | null | null | tests/unit/common/db/test_api.py | onecloud/gbp-rally | 7589b1788c4de26bb66c531ef340ba080754f8c3 | [
"Apache-2.0"
] | null | null | null | tests/unit/common/db/test_api.py | onecloud/gbp-rally | 7589b1788c4de26bb66c531ef340ba080754f8c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 43.066225 | 79 | 0.634579 |
from six import moves
from rally.common import db
from rally import consts
from rally import exceptions
from tests.unit import test
class TasksTestCase(test.DBTestCase):
def setUp(self):
super(TasksTestCase, self).setUp()
self.deploy = db.deployment_create({})
def _get_task(self, uuid):
... | true | true |
f73072bb0fa62e6519596da6e47d9a8d23c2a32a | 1,146 | py | Python | src/wsgi.py | mine-archived/dinner | 0b7e556994a6f8e91450377631f88694a97fdcf7 | [
"MIT"
] | null | null | null | src/wsgi.py | mine-archived/dinner | 0b7e556994a6f8e91450377631f88694a97fdcf7 | [
"MIT"
] | null | null | null | src/wsgi.py | mine-archived/dinner | 0b7e556994a6f8e91450377631f88694a97fdcf7 | [
"MIT"
] | null | null | null | """
WSGI config for src project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` sett... | 38.2 | 79 | 0.790576 | import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"settings")
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplica... | true | true |
f73073b29e40f88ca0b69b779adcab0c43322bfc | 10,040 | py | Python | modules/feature_extraction.py | OverFitted/ai-academy-2022 | e58a68a13d81f203027cc367f5f335c2b22f0962 | [
"MIT"
] | null | null | null | modules/feature_extraction.py | OverFitted/ai-academy-2022 | e58a68a13d81f203027cc367f5f335c2b22f0962 | [
"MIT"
] | null | null | null | modules/feature_extraction.py | OverFitted/ai-academy-2022 | e58a68a13d81f203027cc367f5f335c2b22f0962 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class VGG_FeatureExtractor(nn.Module):
def __init__(self, input_channel, output_channel=512):
super(VGG_FeatureExtractor, self).__init__()
self.output_channel = ... | 41.659751 | 118 | 0.612251 | import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class VGG_FeatureExtractor(nn.Module):
def __init__(self, input_channel, output_channel=512):
super(VGG_FeatureExtractor, self).__init__()
self.output_channel = ... | true | true |
f73075b082a65a62398c6c4d6ab5bdf795ac00ee | 8,704 | py | Python | examples/python-guide/Gaussian_process_mixed_effects_models_example.py | StatMixedML/GPBoost | 786d8be61c5c28da0690e167af636a6d777bf9e1 | [
"Apache-2.0"
] | 2 | 2020-04-12T06:12:17.000Z | 2020-04-12T15:34:01.000Z | examples/python-guide/Gaussian_process_mixed_effects_models_example.py | StatMixedML/GPBoost | 786d8be61c5c28da0690e167af636a6d777bf9e1 | [
"Apache-2.0"
] | null | null | null | examples/python-guide/Gaussian_process_mixed_effects_models_example.py | StatMixedML/GPBoost | 786d8be61c5c28da0690e167af636a6d777bf9e1 | [
"Apache-2.0"
] | 1 | 2020-04-12T15:34:12.000Z | 2020-04-12T15:34:12.000Z | # coding: utf-8
# pylint: disable = invalid-name, C0111
import gpboost as gpb
import numpy as np
# import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
# --------------------Grouped random effects model: single-level random effect----------------
# Simulate data
n = 100 # number of samples
m = ... | 42.048309 | 110 | 0.654756 | import gpboost as gpb
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
n = 100 m = 25 group = np.arange(n) for i in range(m):
group[int(i * n / m):int((i + 1) * n / m)] = i
Z1 = np.zeros((n, m))
for i in range(m):
Z1[np.where(group == i), i] = 1
sigma2_1 = 1 ** 2 sigma2 = 0.5 ** 2... | true | true |
f73075bef3ed405f4ed01eba617bcacbd18b5ea5 | 10,394 | py | Python | tests/test_renault_vehicle.py | Nebukadneza/renault-api | 30fdcc405575ca394c98b556878260da787c9ffc | [
"MIT"
] | null | null | null | tests/test_renault_vehicle.py | Nebukadneza/renault-api | 30fdcc405575ca394c98b556878260da787c9ffc | [
"MIT"
] | null | null | null | tests/test_renault_vehicle.py | Nebukadneza/renault-api | 30fdcc405575ca394c98b556878260da787c9ffc | [
"MIT"
] | null | null | null | """Test cases for the Renault client API keys."""
from datetime import datetime
from typing import List
import aiohttp
import pytest
from aioresponses import aioresponses
from tests import get_file_content
from tests.const import TEST_ACCOUNT_ID
from tests.const import TEST_COUNTRY
from tests.const import TEST_KAMEREO... | 35.233898 | 88 | 0.681547 | from datetime import datetime
from typing import List
import aiohttp
import pytest
from aioresponses import aioresponses
from tests import get_file_content
from tests.const import TEST_ACCOUNT_ID
from tests.const import TEST_COUNTRY
from tests.const import TEST_KAMEREON_URL
from tests.const import TEST_LOCALE_DETAILS
... | true | true |
f73076c02920003b04f8d7e5599366f2dce13c0e | 1,277 | py | Python | randomgenius.py | JosephCottingham/MusicPlaylist-LinkedList | bb8014158fed05b45194705424bc5830ed25527a | [
"MIT"
] | null | null | null | randomgenius.py | JosephCottingham/MusicPlaylist-LinkedList | bb8014158fed05b45194705424bc5830ed25527a | [
"MIT"
] | null | null | null | randomgenius.py | JosephCottingham/MusicPlaylist-LinkedList | bb8014158fed05b45194705424bc5830ed25527a | [
"MIT"
] | null | null | null | import requests, json, random, sys, configparser
#def getData(auth_string, id):
def getData():
global auth_token
s = random.randint(100000, 1000000)
id_str = str(s)
request_url = "http://api.genius.com/songs/" + id_str
headersMap = {
"User-Agent": "CompuServe Classic/1.22",
... | 29.697674 | 61 | 0.628034 | import requests, json, random, sys, configparser
def getData():
global auth_token
s = random.randint(100000, 1000000)
id_str = str(s)
request_url = "http://api.genius.com/songs/" + id_str
headersMap = {
"User-Agent": "CompuServe Classic/1.22",
"Accept": "application/json",
... | true | true |
f73077be389c6681ad96c3ab9228da1f85632f08 | 2,263 | py | Python | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20141111/SetHttpHeaderConfigRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20141111/SetHttpHeaderConfigRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20141111/SetHttpHeaderConfigRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"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... | 33.776119 | 74 | 0.764914 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkcdn.endpoint import endpoint_data
class SetHttpHeaderConfigRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Cdn', '2014-11-11', 'SetHttpHeaderConfig')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map", endpoint_data.ge... | true | true |
f7307823c40ee64d03118ec461eb3103c01b9c29 | 5,544 | py | Python | Heats/scoresheetsHtml.py | yuxuibbs/MCC-Competition-Docs | 384726c41434c5a07becb6438c3d2409c6ca6eb4 | [
"MIT"
] | 4 | 2016-11-13T20:49:33.000Z | 2017-12-20T20:03:03.000Z | Heats/scoresheetsHtml.py | yuxuibbs/MCC-Competition-Docs | 384726c41434c5a07becb6438c3d2409c6ca6eb4 | [
"MIT"
] | 5 | 2016-12-26T19:14:46.000Z | 2022-02-11T03:44:39.000Z | Heats/scoresheetsHtml.py | yuxuibbs/MCC-Competition-Docs | 384726c41434c5a07becb6438c3d2409c6ca6eb4 | [
"MIT"
] | 2 | 2016-12-29T12:03:15.000Z | 2017-02-16T15:51:02.000Z | startHTML = '''
<html>
<head>
<style>
table {
border-collapse: collapse;
height: 100%;
width: 100%;
}
table, th, td {
border: 3px solid black;
}
@media print {
table {
page-break-after: always;
... | 25.906542 | 64 | 0.418831 | startHTML = '''
<html>
<head>
<style>
table {
border-collapse: collapse;
height: 100%;
width: 100%;
}
table, th, td {
border: 3px solid black;
}
@media print {
table {
page-break-after: always;
... | true | true |
f7307828ee10c47bd1ad7591cd1e3358963ef61f | 1,063 | py | Python | authors/apps/authentication/tests/test_login.py | andela/ah-backend-thanos | baf7f20a023cc3c3ecae0fcf91bb7d9165e79fc8 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/authentication/tests/test_login.py | andela/ah-backend-thanos | baf7f20a023cc3c3ecae0fcf91bb7d9165e79fc8 | [
"BSD-3-Clause"
] | 42 | 2018-10-24T08:21:07.000Z | 2021-06-10T20:54:39.000Z | authors/apps/authentication/tests/test_login.py | andela/ah-backend-thanos | baf7f20a023cc3c3ecae0fcf91bb7d9165e79fc8 | [
"BSD-3-Clause"
] | 2 | 2018-11-05T08:56:42.000Z | 2019-05-03T12:40:43.000Z | from rest_framework import status
from django.contrib.auth import get_user_model
from rest_framework.reverse import reverse
from .basetest import BaseTestCase
User = get_user_model()
signup_url = reverse("authentication:signup")
login_url = reverse("authentication:login")
class UserApiTestCase(BaseTestCase):
d... | 34.290323 | 77 | 0.643462 | from rest_framework import status
from django.contrib.auth import get_user_model
from rest_framework.reverse import reverse
from .basetest import BaseTestCase
User = get_user_model()
signup_url = reverse("authentication:signup")
login_url = reverse("authentication:login")
class UserApiTestCase(BaseTestCase):
d... | true | true |
f73078ac1b77d76adea8e2e058894be4fc7fa673 | 4,504 | py | Python | techno_files/eic25_zawieszki.py | lukaszmachura/ejc2019_name_badge | 13996bdfc25958129fda26a8692c1e08c016eae4 | [
"MIT"
] | null | null | null | techno_files/eic25_zawieszki.py | lukaszmachura/ejc2019_name_badge | 13996bdfc25958129fda26a8692c1e08c016eae4 | [
"MIT"
] | null | null | null | techno_files/eic25_zawieszki.py | lukaszmachura/ejc2019_name_badge | 13996bdfc25958129fda26a8692c1e08c016eae4 | [
"MIT"
] | null | null | null | import subprocess
import os
def read_list(fname="lista.csv"):
for row in open(fname):
yield row
def write_preamble(fname):
preamble = r"""%25 EIC technology, (C) LM 2018
\documentclass{article}
\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{anyfontsize}
\usepackage{fon... | 23.458333 | 76 | 0.552398 | import subprocess
import os
def read_list(fname="lista.csv"):
for row in open(fname):
yield row
def write_preamble(fname):
preamble = r"""%25 EIC technology, (C) LM 2018
\documentclass{article}
\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{anyfontsize}
\usepackage{fon... | true | true |
f73079477a3e239cd6a9759ffd6c3d612f6a5ff4 | 9,121 | py | Python | google/ads/google_ads/interceptors/interceptor.py | allandproust/google-ads-python | 004d283f5c9031748782884daad41d97c281cafa | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/interceptors/interceptor.py | allandproust/google-ads-python | 004d283f5c9031748782884daad41d97c281cafa | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/interceptors/interceptor.py | allandproust/google-ads-python | 004d283f5c9031748782884daad41d97c281cafa | [
"Apache-2.0"
] | 1 | 2020-03-13T00:14:31.000Z | 2020-03-13T00:14:31.000Z | # Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.846473 | 82 | 0.63129 |
from collections import namedtuple
from importlib import import_module
import json
from google.protobuf.message import DecodeError
from grpc import ClientCallDetails, StatusCode
from google.ads.google_ads.errors import GoogleAdsException
_REQUEST_ID_KEY = 'request-id'
_RETRY_STATUS_CODES = (StatusCode.INTERNAL, Sta... | true | true |
f7307a29a25257c1fb187abf7a58e0c31eda5993 | 17,968 | py | Python | toolchain/riscv/MSYS/python/Lib/test/test_platform.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | null | null | null | toolchain/riscv/MSYS/python/Lib/test/test_platform.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 1 | 2020-04-23T02:34:53.000Z | 2020-04-23T02:34:53.000Z | toolchain/riscv/MSYS/python/Lib/test/test_platform.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 1 | 2020-04-27T15:07:54.000Z | 2020-04-27T15:07:54.000Z | from unittest import mock
import os
import platform
import subprocess
import sys
import sysconfig
import tempfile
import unittest
import warnings
from test import support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
@support.skip_un... | 41.689095 | 114 | 0.512077 | from unittest import mock
import os
import platform
import subprocess
import sys
import sysconfig
import tempfile
import unittest
import warnings
from test import support
class PlatformTest(unittest.TestCase):
def test_architecture(self):
res = platform.architecture()
@support.skip_un... | true | true |
f7307a51d6578e0dff654d9626eca5b71b10855a | 2,435 | py | Python | src/core/magicae/core.py | ravenSanstete/hako | fe72c76e9f319add1921a63dee711f90f4960873 | [
"MIT"
] | 1 | 2016-11-17T07:15:00.000Z | 2016-11-17T07:15:00.000Z | src/core/magicae/core.py | ravenSanstete/hako | fe72c76e9f319add1921a63dee711f90f4960873 | [
"MIT"
] | 6 | 2016-11-17T10:27:38.000Z | 2016-11-18T13:20:05.000Z | src/core/magicae/core.py | ravenSanstete/hako | fe72c76e9f319add1921a63dee711f90f4960873 | [
"MIT"
] | null | null | null | """
Implementation of an auxiliary class that as an intermediate layer of Monad and Prototype
A Function Class
"""
import functools as F
from __init__ import utils
from __init__ import proto
# a magica determines (A) the way to distribute the difference to each prototype
# (B) the way to measure o... | 48.7 | 120 | 0.720329 |
import functools as F
from __init__ import utils
from __init__ import proto
class Magica(object):
def __init__(self):
super(Magica,self).__init__()
def mix(self, prototypes):
utils.check_types(prototypes,proto.Prototype);
return F.partial(measure, self, prototypes), F.partial(prop... | true | true |
f7307ab549cd6a961231f29a99a04cc4dd37c4f8 | 2,822 | py | Python | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_multi_out_stateful.py | AnomalyInc/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | 2 | 2017-04-27T11:04:27.000Z | 2019-02-07T21:03:32.000Z | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_multi_out_stateful.py | StreamPy/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | null | null | null | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_multi_out_stateful.py | StreamPy/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | null | null | null | """This module contains examples of stream_func where f_type
is 'element' and stream_func has a list of multiple input streams,
a single output stream, and the operation is stateless. These
examples must have a LIST of input streams and not a single
input stream.
The functions on static Python data structures are of t... | 28.795918 | 82 | 0.642807 | """This module contains examples of stream_func where f_type
is 'element' and stream_func has a list of multiple input streams,
a single output stream, and the operation is stateless. These
examples must have a LIST of input streams and not a single
input stream.
The functions on static Python data structures are of t... | false | true |
f7307f0a3175323d41f8181d3a53d0ce5b8e591e | 3,465 | py | Python | src/programy/parser/template/nodes/system.py | cen-ai/program-y | a753667638147544c54dbebd9f1c8f9ae7f2159e | [
"MIT"
] | 5 | 2018-08-21T00:13:45.000Z | 2018-09-01T20:00:55.000Z | src/programy/parser/template/nodes/system.py | cen-ai/program-y | a753667638147544c54dbebd9f1c8f9ae7f2159e | [
"MIT"
] | 1 | 2018-09-12T18:30:17.000Z | 2018-09-12T18:30:17.000Z | src/programy/parser/template/nodes/system.py | cen-ai/program-y | a753667638147544c54dbebd9f1c8f9ae7f2159e | [
"MIT"
] | 5 | 2018-08-21T00:08:36.000Z | 2018-09-23T06:11:04.000Z | """
Copyright (c) 2016-2018 Keith Sterling http://www.keithsterling.com
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, m... | 42.777778 | 120 | 0.679076 |
from programy.utils.logging.ylogger import YLogger
import subprocess
from programy.parser.exceptions import ParserException
from programy.parser.template.nodes.attrib import TemplateAttribNode
class TemplateSystemNode(TemplateAttribNode):
def __init__(self):
TemplateAttribNode.__init__(self)
se... | true | true |
f73080eed9178010cd0131e215e25b70104b6075 | 1,483 | py | Python | engine/test_cloud_init.py | cnrancher/os-tests | 57d46413954e602e81cad287410dfecf46bfef84 | [
"Apache-2.0"
] | 2 | 2018-11-14T17:02:02.000Z | 2019-07-19T07:13:41.000Z | engine/test_cloud_init.py | cnrancher/os-tests | 57d46413954e602e81cad287410dfecf46bfef84 | [
"Apache-2.0"
] | 13 | 2018-11-06T09:29:50.000Z | 2019-12-23T07:36:07.000Z | engine/test_cloud_init.py | cnrancher/os-tests | 57d46413954e602e81cad287410dfecf46bfef84 | [
"Apache-2.0"
] | 1 | 2018-11-05T04:03:20.000Z | 2018-11-05T04:03:20.000Z | # coding = utf-8
# Create date: 2018-11-20
# Author :Hailong
from utils.connect_to_os import executor, connection
def test_cloud_init(ros_kvm_init, cloud_config_url):
kwargs = dict(cloud_config='{url}test_cloud_init.yml'.format(url=cloud_config_url),
is_install_to_hard_drive=True)
tuple_retu... | 35.309524 | 110 | 0.647336 | from utils.connect_to_os import executor, connection
def test_cloud_init(ros_kvm_init, cloud_config_url):
kwargs = dict(cloud_config='{url}test_cloud_init.yml'.format(url=cloud_config_url),
is_install_to_hard_drive=True)
tuple_return = ros_kvm_init(**kwargs)
client = tuple_return[0]
... | true | true |
f730815c16e59fb5fe9c61f2d195fe9da671f9b0 | 1,023 | py | Python | Python/as-far-from-land-as-possible.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | Python/as-far-from-land-as-possible.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | Python/as-far-from-land-as-possible.py | sm2774us/leetcode_interview_prep_2021 | 33b41bea66c266b733372d9a8b9d2965cd88bf8c | [
"Fair"
] | null | null | null | # Time: O(m * n)
# Space: O(m * n)
import collections
class Solution(object):
def maxDistance(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
q = collections.deque([(i, j) for i in range(len(grid))
... | 30.088235 | 87 | 0.379277 |
import collections
class Solution(object):
def maxDistance(self, grid):
directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
q = collections.deque([(i, j) for i in range(len(grid))
for j in range(len(grid[0])) if grid[i][j] == 1])
if len(q) == len(grid)*le... | true | true |
f73081bc0d5f8d3350d07a2150f753fd344a22a7 | 623 | py | Python | guanabara/Exercicios/mundo 1 _ aulas 01 a 12/001-003.py | pbittencourt/datasciencestudies | 85f0b2a4366fe7c6daa5628ed4bd2994355963c0 | [
"MIT"
] | null | null | null | guanabara/Exercicios/mundo 1 _ aulas 01 a 12/001-003.py | pbittencourt/datasciencestudies | 85f0b2a4366fe7c6daa5628ed4bd2994355963c0 | [
"MIT"
] | null | null | null | guanabara/Exercicios/mundo 1 _ aulas 01 a 12/001-003.py | pbittencourt/datasciencestudies | 85f0b2a4366fe7c6daa5628ed4bd2994355963c0 | [
"MIT"
] | null | null | null | # PRIMEIROS PASSOS
"""
Imprime OLÁ, MUNDO na tela -- obviamente!
Pede nome do usuário e dois números.
Exibe nome do usuário e a soma dos números inseridos
"""
print('Hello, world!!!')
nome = input('Qual é o seu nome? ')
print('Olá, {}, é um prazer te conhecer!'.format(nome))
#
idade = int(input('Qual é a sua idade? ')... | 32.789474 | 86 | 0.659711 |
print('Hello, world!!!')
nome = input('Qual é o seu nome? ')
print('Olá, {}, é um prazer te conhecer!'.format(nome))
idade = int(input('Qual é a sua idade? '))
print('Você tem {} anos e ano que vem você terá {} anos' .format(idade, idade + 1))
n1 = int(input('Aproveitando a brincadeira, {}, digita um número aí: ' .fo... | true | true |
f73081bcbbb55a3e2f6093ea3985232180c04f1a | 1,812 | py | Python | homework/HW4/HW4-final/P1.py | TangJiahui/cs107_system_devlopment | c46d7769683d9be0c31973e3b0666e3fe2a4099b | [
"MIT"
] | null | null | null | homework/HW4/HW4-final/P1.py | TangJiahui/cs107_system_devlopment | c46d7769683d9be0c31973e3b0666e3fe2a4099b | [
"MIT"
] | null | null | null | homework/HW4/HW4-final/P1.py | TangJiahui/cs107_system_devlopment | c46d7769683d9be0c31973e3b0666e3fe2a4099b | [
"MIT"
] | 1 | 2021-09-21T16:28:51.000Z | 2021-09-21T16:28:51.000Z | import numpy as np
import matplotlib.pyplot as plt
# Part A: Numerical Differentiation Closure
def numerical_diff(f,h):
def inner(x):
return (f(x+h) - f(x))/h
return inner
# Part B:
f = np.log
x = np.linspace(0.2, 0.4, 500)
h = [1e-1, 1e-7, 1e-15]
y_analytical = 1/x
result = {}
for i in h:
y = n... | 38.553191 | 219 | 0.724614 | import numpy as np
import matplotlib.pyplot as plt
def numerical_diff(f,h):
def inner(x):
return (f(x+h) - f(x))/h
return inner
f = np.log
x = np.linspace(0.2, 0.4, 500)
h = [1e-1, 1e-7, 1e-15]
y_analytical = 1/x
result = {}
for i in h:
y = numerical_diff(f,i)(x)
result[i] = y
plt.figure(fi... | true | true |
f730824ede58439b2808be47b15c08761386514e | 10,409 | py | Python | neutron/plugins/mlnx/db/mlnx_db_v2.py | petrutlucian94/neutron | 44976d12bbe72331e536d92bb46e35a8835a75ce | [
"Apache-2.0"
] | null | null | null | neutron/plugins/mlnx/db/mlnx_db_v2.py | petrutlucian94/neutron | 44976d12bbe72331e536d92bb46e35a8835a75ce | [
"Apache-2.0"
] | null | null | null | neutron/plugins/mlnx/db/mlnx_db_v2.py | petrutlucian94/neutron | 44976d12bbe72331e536d92bb46e35a8835a75ce | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Mellanox Technologies, Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 39.729008 | 79 | 0.614372 |
from sqlalchemy.orm import exc
from neutron.common import exceptions as q_exc
import neutron.db.api as db
from neutron.db import models_v2
from neutron.db import securitygroups_db as sg_db
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.plugins.mlnx.common import config f... | true | true |
f7308345fe160b2a1f7b7c825a95a3b7f2aa10bc | 6,872 | py | Python | scripts/07_tensor_linear_regresssion.py | UnacceptableBehaviour/pytorch_tut_00 | ca74b9bde8485f651bda9314b8f4a7ed277db787 | [
"MIT"
] | null | null | null | scripts/07_tensor_linear_regresssion.py | UnacceptableBehaviour/pytorch_tut_00 | ca74b9bde8485f651bda9314b8f4a7ed277db787 | [
"MIT"
] | null | null | null | scripts/07_tensor_linear_regresssion.py | UnacceptableBehaviour/pytorch_tut_00 | ca74b9bde8485f651bda9314b8f4a7ed277db787 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# PyTorch Tutorial 07 - Linear Regression
# https://www.youtube.com/watch?v=YAJ5XBwlN4o&list=PLqnslRFeH2UrcDBWF5mfPGpqQDSta6VK4&index=7
#from __future__ import print_function
import torch
print("\n" * 20)
print("-" * 80)
print("-" * 80)
print("\n" * 2)
#### Steps in Torch ML pipeline
# 1) Desi... | 42.95 | 120 | 0.625437 |
import torch
print("\n" * 20)
print("-" * 80)
print("-" * 80)
print("\n" * 2)
import torch
import torch.nn as nn
import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt
x_numpy, y_numpy = datasets.make_regression(n_samp... | true | true |
f73083901e3441f13ab867dc840908e3619b3a39 | 18,332 | py | Python | zerver/lib/markdown/fenced_code.py | narendrapsgim/zulip | e2df0d171f921d1e2b09d5de72088ffcc6a0f5f4 | [
"Apache-2.0"
] | 17,004 | 2015-09-25T18:27:24.000Z | 2022-03-31T22:02:32.000Z | zerver/lib/markdown/fenced_code.py | narendrapsgim/zulip | e2df0d171f921d1e2b09d5de72088ffcc6a0f5f4 | [
"Apache-2.0"
] | 20,344 | 2015-09-25T19:02:42.000Z | 2022-03-31T23:54:40.000Z | zerver/lib/markdown/fenced_code.py | narendrapsgim/zulip | e2df0d171f921d1e2b09d5de72088ffcc6a0f5f4 | [
"Apache-2.0"
] | 7,271 | 2015-09-25T18:48:39.000Z | 2022-03-31T21:06:11.000Z | """
Fenced Code Extension for Python Markdown
=========================================
This extension adds Fenced Code Blocks to Python-Markdown.
>>> import markdown
>>> text = '''
... A paragraph before a fenced code block:
...
... ~~~
... Fenced code block
... ~~~
... '''
>>> ht... | 32.971223 | 100 | 0.603971 | import re
from typing import Any, Callable, Dict, Iterable, List, Mapping, MutableSequence, Optional, Sequence
import lxml.html
from django.utils.html import escape
from markdown import Markdown
from markdown.extensions import Extension, codehilite
from markdown.extensions.codehilite import CodeHiliteExtension, parse_... | true | true |
f73083f83f4bca4deac6272da174e16b8fa14446 | 3,149 | py | Python | heat/tests/clients/test_glance_client.py | ISCAS-VDI/heat-base | ca8390434edfd8396c7e46651e1e31ff488b2307 | [
"Apache-2.0"
] | 1 | 2015-12-18T21:46:55.000Z | 2015-12-18T21:46:55.000Z | heat/tests/clients/test_glance_client.py | ISCAS-VDI/heat-base | ca8390434edfd8396c7e46651e1e31ff488b2307 | [
"Apache-2.0"
] | null | null | null | heat/tests/clients/test_glance_client.py | ISCAS-VDI/heat-base | ca8390434edfd8396c7e46651e1e31ff488b2307 | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 38.876543 | 79 | 0.643061 |
import uuid
from glanceclient import exc
from glanceclient.openstack.common.apiclient import exceptions
import mock
from heat.engine.clients.os import glance
from heat.tests import common
from heat.tests import utils
class GlanceUtilsTest(common.HeatTestCase):
def setUp(self):
super(GlanceUtilsTest, s... | true | true |
f730842547db0fa4ac95c76cc51c2fc28fb8e9b8 | 7,385 | py | Python | imcsdk/mometa/export/ExportLdapCACertificate.py | vadimkuznetsov/imcsdk | ed038ce1dbc8031f99d2dfb3ccee3bf0b48309d8 | [
"Apache-2.0"
] | null | null | null | imcsdk/mometa/export/ExportLdapCACertificate.py | vadimkuznetsov/imcsdk | ed038ce1dbc8031f99d2dfb3ccee3bf0b48309d8 | [
"Apache-2.0"
] | null | null | null | imcsdk/mometa/export/ExportLdapCACertificate.py | vadimkuznetsov/imcsdk | ed038ce1dbc8031f99d2dfb3ccee3bf0b48309d8 | [
"Apache-2.0"
] | 1 | 2019-11-10T18:42:04.000Z | 2019-11-10T18:42:04.000Z | """This module contains the general information for ExportLdapCACertificate ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class ExportLdapCACertificateConsts:
PROTOCOL_FTP = "ftp"
PROTOCOL_HTTP = "http"
PROTOCOL_N... | 69.018692 | 907 | 0.579282 |
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class ExportLdapCACertificateConsts:
PROTOCOL_FTP = "ftp"
PROTOCOL_HTTP = "http"
PROTOCOL_NONE = "none"
PROTOCOL_SCP = "scp"
PROTOCOL_SFTP = "sftp"
PROTOCOL_TFTP = "tftp"
... | true | true |
f730844764dcd79f2f76188b5b0b2bdde3759d30 | 30,151 | py | Python | eta/core/labels.py | MagicCodess/eta | 4599292a4de1f5f477e159787e2c2127d9fbde1b | [
"Apache-2.0"
] | null | null | null | eta/core/labels.py | MagicCodess/eta | 4599292a4de1f5f477e159787e2c2127d9fbde1b | [
"Apache-2.0"
] | null | null | null | eta/core/labels.py | MagicCodess/eta | 4599292a4de1f5f477e159787e2c2127d9fbde1b | [
"Apache-2.0"
] | null | null | null | """
Core data structures for working with labels.
Copyright 2017-2022, Voxel51, Inc.
voxel51.com
"""
# pragma pylint: disable=redefined-builtin
# pragma pylint: disable=unused-wildcard-import
# pragma pylint: disable=wildcard-import
from __future__ import absolute_import
from __future__ import division
from __future__... | 30.000995 | 79 | 0.629631 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
from future.utils import iteritems
from collections import defaultdict
import logging
import eta.core.serial as etas
import eta.core.utils as eta... | true | true |
f73084dd6dc2a8e45a03307bb76941dc0e054034 | 2,458 | py | Python | examples/image_classification/classify.py | sergioalberto/rpi-deep-learning | 94024c2b2c225dc607954874bdcd345b805b1561 | [
"MIT"
] | null | null | null | examples/image_classification/classify.py | sergioalberto/rpi-deep-learning | 94024c2b2c225dc607954874bdcd345b805b1561 | [
"MIT"
] | 14 | 2021-03-19T04:37:26.000Z | 2022-03-12T00:23:16.000Z | examples/image_classification/classify.py | sergioalberto/rpi-deep-learning-lab | 94024c2b2c225dc607954874bdcd345b805b1561 | [
"MIT"
] | null | null | null | # Copyright 2019 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... | 34.619718 | 91 | 0.767697 |
from tensorflow.lite.python.interpreter import Interpreter
import numpy as np
import argparse
from PIL import Image
parser = argparse.ArgumentParser(description='Image Classification')
parser.add_argument('--filename', type=str, help='Specify the filename', required=True)
parser.add_argument('--model_path', type=str... | true | true |
f73086577458af1fa28ed63eff9c394107997af2 | 29,942 | py | Python | binance/websockets.py | pnpn521521/python-binance-with-futures-websocket | 483737fb364f4de07427df4c2b76e63561b40bbb | [
"MIT"
] | 17 | 2020-04-22T11:24:11.000Z | 2022-03-14T10:03:02.000Z | binance/websockets.py | pnpn521521/python-binance-with-futures-websocket | 483737fb364f4de07427df4c2b76e63561b40bbb | [
"MIT"
] | null | null | null | binance/websockets.py | pnpn521521/python-binance-with-futures-websocket | 483737fb364f4de07427df4c2b76e63561b40bbb | [
"MIT"
] | 7 | 2020-06-30T20:30:28.000Z | 2021-07-28T02:25:27.000Z | # coding=utf-8
import json
import threading
from autobahn.twisted.websocket import WebSocketClientFactory, \
WebSocketClientProtocol, \
connectWS
from twisted.internet import reactor, ssl
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.internet.error import ReactorAlreadyRunning
... | 36.514634 | 141 | 0.583962 |
import json
import threading
from autobahn.twisted.websocket import WebSocketClientFactory, \
WebSocketClientProtocol, \
connectWS
from twisted.internet import reactor, ssl
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.internet.error import ReactorAlreadyRunning
from binance.cl... | true | true |
f7308663c6efc7fb20c889452d367dd74dc0ad2d | 5,218 | py | Python | mantrid/cli.py | epio/mantrid | 1c699f1a4b33888b533c19cb6d025173f2160576 | [
"BSD-3-Clause"
] | 30 | 2015-01-01T00:32:47.000Z | 2021-09-07T20:25:01.000Z | mantrid/cli.py | epio/mantrid | 1c699f1a4b33888b533c19cb6d025173f2160576 | [
"BSD-3-Clause"
] | null | null | null | mantrid/cli.py | epio/mantrid | 1c699f1a4b33888b533c19cb6d025173f2160576 | [
"BSD-3-Clause"
] | 9 | 2015-05-12T05:09:12.000Z | 2021-12-29T19:07:01.000Z | import sys
from .client import MantridClient
class MantridCli(object):
"""Command line interface to Mantrid"""
def __init__(self, base_url):
self.client = MantridClient(base_url)
@classmethod
def main(cls):
cli = cls("http://localhost:8042")
cli.run(sys.argv)
@property
... | 36.236111 | 88 | 0.478153 | import sys
from .client import MantridClient
class MantridCli(object):
"""Command line interface to Mantrid"""
def __init__(self, base_url):
self.client = MantridClient(base_url)
@classmethod
def main(cls):
cli = cls("http://localhost:8042")
cli.run(sys.argv)
@property
... | false | true |
f73087aa81776159702022d95866d5b4fbe8cb4f | 3,942 | py | Python | level3/usb/decrypt.py | fishilico/sstic-2016 | 9a05bb18df4c8d2e76f1e30fda6b38b1bc930e8c | [
"Beerware"
] | null | null | null | level3/usb/decrypt.py | fishilico/sstic-2016 | 9a05bb18df4c8d2e76f1e30fda6b38b1bc930e8c | [
"Beerware"
] | null | null | null | level3/usb/decrypt.py | fishilico/sstic-2016 | 9a05bb18df4c8d2e76f1e30fda6b38b1bc930e8c | [
"Beerware"
] | 1 | 2020-04-03T06:19:11.000Z | 2020-04-03T06:19:11.000Z | #!/usr/bin/env python3
import binascii
import hashlib
import os.path
import struct
import sys
sys.path.insert(0, os.path.dirname(__file__))
import rc4
# Helper functions
def rol32(val, shift):
val = val & 0xffffffff
shift = shift & 0x1f
if not shift:
return val
return ((val << shift) & 0xffff... | 32.04878 | 86 | 0.691781 | import binascii
import hashlib
import os.path
import struct
import sys
sys.path.insert(0, os.path.dirname(__file__))
import rc4
def rol32(val, shift):
val = val & 0xffffffff
shift = shift & 0x1f
if not shift:
return val
return ((val << shift) & 0xffffffff) | (val >> (32 - shift))
def ror32(v... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.