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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74e359cfb83844239e6a1d3a21164cea412b971 | 253 | py | Python | Notebook/utils/tools/unfile.py | XinetAI/CVX | c4cbcf9062a156819b33d0da1584a03026555a82 | [
"MIT"
] | 17 | 2019-01-28T01:46:00.000Z | 2021-11-18T16:16:55.000Z | Notebook/utils/tools/unfile.py | XinetAI/CVX | c4cbcf9062a156819b33d0da1584a03026555a82 | [
"MIT"
] | null | null | null | Notebook/utils/tools/unfile.py | XinetAI/CVX | c4cbcf9062a156819b33d0da1584a03026555a82 | [
"MIT"
] | 6 | 2019-12-18T09:31:09.000Z | 2022-03-09T09:04:30.000Z | import tarfile
import os
def untar(tar_name, root):
'''
解压 tar.gz 文件并返回路径
root:解压的根目录
'''
with tarfile.open(tar_name) as tar:
tar.extractall(root)
tar_root = tar.getnames()[0]
return os.path.join(root, tar_root) | 19.461538 | 39 | 0.624506 | import tarfile
import os
def untar(tar_name, root):
with tarfile.open(tar_name) as tar:
tar.extractall(root)
tar_root = tar.getnames()[0]
return os.path.join(root, tar_root) | true | true |
f74e36238e579442e28eb6340318668a6f53a997 | 6,610 | py | Python | factory-ai-vision/EdgeSolution/modules/OVMSAdaptorModule/app/ovms_batchImageProcessor.py | michellechena/azure-intelligent-edge-patterns | b1260b962b208880532391e7ef2148d240f489f8 | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/OVMSAdaptorModule/app/ovms_batchImageProcessor.py | michellechena/azure-intelligent-edge-patterns | b1260b962b208880532391e7ef2148d240f489f8 | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/OVMSAdaptorModule/app/ovms_batchImageProcessor.py | michellechena/azure-intelligent-edge-patterns | b1260b962b208880532391e7ef2148d240f489f8 | [
"MIT"
] | null | null | null | import logging
from PIL import Image, ImageDraw
import io
import numpy as np
from tensorflow import make_tensor_proto, make_ndarray
import cv2
import inferencing_pb2
import media_pb2
import extension_pb2
import os
import ovms
import time
from cascade.voe_to_ovms import load_voe_config_from_json, voe_config_to_ovms_con... | 37.988506 | 146 | 0.515582 | import logging
from PIL import Image, ImageDraw
import io
import numpy as np
from tensorflow import make_tensor_proto, make_ndarray
import cv2
import inferencing_pb2
import media_pb2
import extension_pb2
import os
import ovms
import time
from cascade.voe_to_ovms import load_voe_config_from_json, voe_config_to_ovms_con... | true | true |
f74e3625bc392738d6c161f600dbdc4f60a0f932 | 23,313 | py | Python | tf_agents/bandits/agents/greedy_reward_prediction_agent_test.py | anair13/agents | ef7fb0aba6fb3c00cad20abdc6d181cbbb3f77df | [
"Apache-2.0"
] | 3,175 | 2017-09-08T18:28:32.000Z | 2022-03-31T01:32:22.000Z | tf_agents/bandits/agents/greedy_reward_prediction_agent_test.py | MFosset/agents | 756f7bdf493986c25eb585438134f1dbb8045b1b | [
"Apache-2.0"
] | 703 | 2017-09-18T05:51:57.000Z | 2022-03-31T17:37:50.000Z | tf_agents/bandits/agents/greedy_reward_prediction_agent_test.py | MFosset/agents | 756f7bdf493986c25eb585438134f1dbb8045b1b | [
"Apache-2.0"
] | 844 | 2017-09-08T23:28:57.000Z | 2022-03-30T09:29:32.000Z | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 41.482206 | 83 | 0.687127 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf from tf_agents.bandits.agents import greedy_reward_prediction_agent as greedy_agent
from tf_agents.bandits.drivers import driver_utils
from tf_agents.bandits.networ... | true | true |
f74e36fe664f05eff385e7dee94abbcf61134cdb | 450 | py | Python | setup.py | hayescr/flexce | d3f52adb9e729c530c43e3a57bf4c2be26d78374 | [
"MIT"
] | 9 | 2016-05-02T19:43:00.000Z | 2018-01-09T08:25:28.000Z | setup.py | hayescr/flexce | d3f52adb9e729c530c43e3a57bf4c2be26d78374 | [
"MIT"
] | 4 | 2016-06-03T12:03:08.000Z | 2018-05-30T20:19:42.000Z | setup.py | hayescr/flexce | d3f52adb9e729c530c43e3a57bf4c2be26d78374 | [
"MIT"
] | 6 | 2019-02-27T04:13:11.000Z | 2022-02-11T14:03:52.000Z | from distutils.core import setup
NAME = 'flexCE'
# do not use x.x.x-dev. things complain. instead use x.x.xdev
VERSION = '1.0.1dev'
RELEASE = 'dev' not in VERSION
setup(name=NAME,
version=VERSION,
description='Flexible Galactic Chemical Evolution Model',
author='Brett Andrews',
author_email=... | 28.125 | 63 | 0.675556 | from distutils.core import setup
NAME = 'flexCE'
VERSION = '1.0.1dev'
RELEASE = 'dev' not in VERSION
setup(name=NAME,
version=VERSION,
description='Flexible Galactic Chemical Evolution Model',
author='Brett Andrews',
author_email='brett.h.andrews@gmail.com',
url='https://github.com/brett... | true | true |
f74e3771f1bd9b90f5aa0ef2d13ae033183f31d7 | 17,219 | py | Python | great_expectations/core/evaluation_parameters.py | jaibirsingh/great_expectations | ec7679debbf17495fab490f1b3ddfa9f4f0ae8d7 | [
"Apache-2.0"
] | null | null | null | great_expectations/core/evaluation_parameters.py | jaibirsingh/great_expectations | ec7679debbf17495fab490f1b3ddfa9f4f0ae8d7 | [
"Apache-2.0"
] | null | null | null | great_expectations/core/evaluation_parameters.py | jaibirsingh/great_expectations | ec7679debbf17495fab490f1b3ddfa9f4f0ae8d7 | [
"Apache-2.0"
] | null | null | null | import copy
import datetime
import logging
import math
import operator
import traceback
from collections import namedtuple
from typing import Any, Dict, Optional
from pyparsing import (
CaselessKeyword,
Combine,
Forward,
Group,
Literal,
ParseException,
Regex,
Suppress,
Word,
alp... | 39.312785 | 120 | 0.59353 | import copy
import datetime
import logging
import math
import operator
import traceback
from collections import namedtuple
from typing import Any, Dict, Optional
from pyparsing import (
CaselessKeyword,
Combine,
Forward,
Group,
Literal,
ParseException,
Regex,
Suppress,
Word,
alp... | true | true |
f74e38c6504d925b8a3767327fcaacbb6f846c13 | 2,027 | py | Python | DANN_WGAN_EDSR/utils/options.py | TiagoCortinhal/SR_GAN | 9ccceaa25e87e404d20825dbb552fa6a2ef3af47 | [
"MIT"
] | 4 | 2019-05-21T02:56:31.000Z | 2019-07-04T13:34:29.000Z | DANN_WGAN_EDSR/utils/options.py | TiagoCortinhal/ADASR | 9ccceaa25e87e404d20825dbb552fa6a2ef3af47 | [
"MIT"
] | null | null | null | DANN_WGAN_EDSR/utils/options.py | TiagoCortinhal/ADASR | 9ccceaa25e87e404d20825dbb552fa6a2ef3af47 | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--n_workers',
type=int, default=10,
help='number of data loading workers')
parser.add_argument('--batch-size',
type=int, default=100,
help='input batch size')
parse... | 28.957143 | 76 | 0.541687 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--n_workers',
type=int, default=10,
help='number of data loading workers')
parser.add_argument('--batch-size',
type=int, default=100,
help='input batch size')
parse... | true | true |
f74e390128dc882464457b05137d7803983dd347 | 91,771 | py | Python | indra/assemblers/pysb/assembler.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 136 | 2016-02-11T22:06:37.000Z | 2022-03-31T17:26:20.000Z | indra/assemblers/pysb/assembler.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 748 | 2016-02-03T16:27:56.000Z | 2022-03-09T14:27:54.000Z | indra/assemblers/pysb/assembler.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 56 | 2015-08-28T14:03:44.000Z | 2022-02-04T06:15:55.000Z | import re
import math
import json
import logging
import itertools
from pysb import Model, Monomer, Parameter, Expression, Observable, Rule, \
Annotation, ComponentDuplicateNameError, ComplexPattern, \
ReactionPattern, ANY, WILD, InvalidInitialConditionError
from pysb.core import SelfExporter
from pysb.pattern ... | 41.338288 | 79 | 0.625383 | import re
import math
import json
import logging
import itertools
from pysb import Model, Monomer, Parameter, Expression, Observable, Rule, \
Annotation, ComponentDuplicateNameError, ComplexPattern, \
ReactionPattern, ANY, WILD, InvalidInitialConditionError
from pysb.core import SelfExporter
from pysb.pattern ... | true | true |
f74e39666c9e79f9fae136aa0d0e302c90c8ab41 | 5,664 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/models/cluster_node_status_capacity_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/cluster_node_status_capacity_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/cluster_node_status_capacity_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ClusterNodeStatusCapacity... | 30.95082 | 132 | 0.581568 |
import pprint
import re
import six
class ClusterNodeStatusCapacityItem(object):
swagger_types = {
'bytes': 'int',
'count': 'int',
'type': 'str'
}
attribute_map = {
'bytes': 'bytes',
'count': 'count',
'type': 'type'
}
def __init__(self, bytes=... | true | true |
f74e39f9d2997db4eaca84a74df1e76c804fdb50 | 2,401 | py | Python | my_blog/urls.py | jonneyhu/lynchow | 2172d521ed53375f5c260535ba31ad0ff1873c0d | [
"MIT"
] | 1 | 2020-06-18T02:40:25.000Z | 2020-06-18T02:40:25.000Z | my_blog/urls.py | jonneyhu/lynchow | 2172d521ed53375f5c260535ba31ad0ff1873c0d | [
"MIT"
] | null | null | null | my_blog/urls.py | jonneyhu/lynchow | 2172d521ed53375f5c260535ba31ad0ff1873c0d | [
"MIT"
] | null | null | null | """my_blog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | 42.875 | 113 | 0.734277 | from django.conf.urls import url, include
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
from django.contrib.sitemaps.views import sitemap
from blog.sitemaps import ArticleSitemap, CategorySitemap, TagSitemap
fr... | true | true |
f74e3a4e0591a4674b67462e5f37ea6a2bd21d3f | 7,019 | py | Python | pypy/module/_csv/interp_csv.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | 34 | 2015-07-09T04:53:27.000Z | 2021-07-19T05:22:27.000Z | pypy/module/_csv/interp_csv.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | 6 | 2015-05-30T17:20:45.000Z | 2017-06-12T14:29:23.000Z | pypy/module/_csv/interp_csv.py | wdv4758h/mu-client-pypy | d2fcc01f0b4fe3ffa232762124e3e6d38ed3a0cf | [
"Apache-2.0",
"OpenSSL"
] | 11 | 2015-09-07T14:26:08.000Z | 2020-04-10T07:20:41.000Z | from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.typedef import TypeDef, interp_attrproperty
from pypy.interpreter.typedef import GetSetProperty
from pypy.interpreter.gateway import interp2app
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QU... | 38.994444 | 88 | 0.634848 | from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.typedef import TypeDef, interp_attrproperty
from pypy.interpreter.typedef import GetSetProperty
from pypy.interpreter.gateway import interp2app
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QU... | true | true |
f74e3ae65d1523ef7c5b7686020908fce6995ebc | 821 | py | Python | custom_components/waste_collection_schedule/package/source/example.py | trstns/hacs_waste_collection_schedule | f8f297b43c8e87510e17a558347a88a95f790d7b | [
"MIT"
] | null | null | null | custom_components/waste_collection_schedule/package/source/example.py | trstns/hacs_waste_collection_schedule | f8f297b43c8e87510e17a558347a88a95f790d7b | [
"MIT"
] | null | null | null | custom_components/waste_collection_schedule/package/source/example.py | trstns/hacs_waste_collection_schedule | f8f297b43c8e87510e17a558347a88a95f790d7b | [
"MIT"
] | null | null | null | import datetime
from typing import Dict
from ..helpers import CollectionAppointment
DESCRIPTION = "Example scraper"
URL = ""
TEST_CASES: Dict[str, Dict[str, str]] = {}
class Source:
def __init__(self, days=20, per_day=2, types=5):
self._days = days
self._per_day = per_day
self._types = t... | 24.147059 | 63 | 0.527406 | import datetime
from typing import Dict
from ..helpers import CollectionAppointment
DESCRIPTION = "Example scraper"
URL = ""
TEST_CASES: Dict[str, Dict[str, str]] = {}
class Source:
def __init__(self, days=20, per_day=2, types=5):
self._days = days
self._per_day = per_day
self._types = t... | true | true |
f74e3aff928e3004201c240cd1e7775e1a0f9766 | 82,758 | py | Python | ocrd_tesserocr/recognize.py | OCR-D/ocrd_tesserocr | ac274656bfb7021ccd752bccd947e53403b4a909 | [
"MIT"
] | 37 | 2018-04-16T20:18:25.000Z | 2022-03-06T09:06:12.000Z | ocrd_tesserocr/recognize.py | OCR-D/ocrd_tesserocr | ac274656bfb7021ccd752bccd947e53403b4a909 | [
"MIT"
] | 162 | 2018-04-18T12:17:53.000Z | 2022-03-09T11:07:36.000Z | ocrd_tesserocr/recognize.py | OCR-D/ocrd_tesserocr | ac274656bfb7021ccd752bccd947e53403b4a909 | [
"MIT"
] | 12 | 2018-04-11T11:56:22.000Z | 2021-02-12T15:12:13.000Z | from __future__ import absolute_import
import os.path
import math
from PIL import Image, ImageStat
import numpy as np
from shapely.geometry import Polygon, asPolygon
from shapely.ops import unary_union
from tesserocr import (
RIL, PSM, PT, OEM,
Orientation,
WritingDirection,
TextlineOrder,
tesserac... | 53.016015 | 208 | 0.576838 | from __future__ import absolute_import
import os.path
import math
from PIL import Image, ImageStat
import numpy as np
from shapely.geometry import Polygon, asPolygon
from shapely.ops import unary_union
from tesserocr import (
RIL, PSM, PT, OEM,
Orientation,
WritingDirection,
TextlineOrder,
tesserac... | true | true |
f74e3b6dd74cfec24a35efa0a5e5eccb8e1b060f | 196 | py | Python | livro-trilhas-python/laco.py | actiago/estudos.py | c0aeca05dfc80b6f22e977f26bae3af9af3cbe1a | [
"MIT"
] | 2 | 2020-10-06T12:15:39.000Z | 2020-10-06T12:39:03.000Z | livro-trilhas-python/laco.py | actiago/estudos.py | c0aeca05dfc80b6f22e977f26bae3af9af3cbe1a | [
"MIT"
] | null | null | null | livro-trilhas-python/laco.py | actiago/estudos.py | c0aeca05dfc80b6f22e977f26bae3af9af3cbe1a | [
"MIT"
] | null | null | null | a = int(input("Digite um número: "))
if(a < 10):
print("O valor de a é menor que 10")
elif(a == 10):
print("O valor de a é igual a 10")
else:
print("O valor de a é maior que 10")
| 21.777778 | 44 | 0.571429 | a = int(input("Digite um número: "))
if(a < 10):
print("O valor de a é menor que 10")
elif(a == 10):
print("O valor de a é igual a 10")
else:
print("O valor de a é maior que 10")
| true | true |
f74e3c04ee30760b2d7a056ab8c31b3e57ed1fa8 | 65 | py | Python | tbd/__init__.py | Kreusada/mcoc-v3 | 28aa6e361c836f059f425e75cfa47c0d62720c6f | [
"MIT"
] | null | null | null | tbd/__init__.py | Kreusada/mcoc-v3 | 28aa6e361c836f059f425e75cfa47c0d62720c6f | [
"MIT"
] | null | null | null | tbd/__init__.py | Kreusada/mcoc-v3 | 28aa6e361c836f059f425e75cfa47c0d62720c6f | [
"MIT"
] | null | null | null | from .mcoc-v3 import Tbd
def setup(bot):
bot.add_cog(Tbd(bot))
| 13 | 24 | 0.707692 | from .mcoc-v3 import Tbd
def setup(bot):
bot.add_cog(Tbd(bot))
| false | true |
f74e3c3740e1260be82e8380f40e7256faf80ebc | 299 | py | Python | script/test.py | colinsongf/opinion_reader_bert | ec036fb27161ba454b865e387ed601fe10f57b28 | [
"Apache-2.0"
] | null | null | null | script/test.py | colinsongf/opinion_reader_bert | ec036fb27161ba454b865e387ed601fe10f57b28 | [
"Apache-2.0"
] | null | null | null | script/test.py | colinsongf/opinion_reader_bert | ec036fb27161ba454b865e387ed601fe10f57b28 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
print(tf.__version__)
with tf.device('/device:GPU:0'):
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
| 33.222222 | 73 | 0.622074 | import tensorflow as tf
print(tf.__version__)
with tf.device('/device:GPU:0'):
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
| true | true |
f74e3c8b126c93bd990ce161db18835f24a0c64f | 1,957 | py | Python | Fig4C.py | mansueto-institute/Urban-Growth-Emergent-Statistics | 429f24f7c6c4fdd229b9c9f818197f56910b466d | [
"MIT"
] | 1 | 2022-03-24T03:08:42.000Z | 2022-03-24T03:08:42.000Z | Fig4C.py | mansueto-institute/Urban-Growth-Emergent-Statistics | 429f24f7c6c4fdd229b9c9f818197f56910b466d | [
"MIT"
] | null | null | null | Fig4C.py | mansueto-institute/Urban-Growth-Emergent-Statistics | 429f24f7c6c4fdd229b9c9f818197f56910b466d | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
import scipy.stats as stats
bbar=0.2
abar=0.1
K1=2. # This is like Hook's constant or the curvature of the potential that keeps the noise localized
#K0=5.
K0=(4.*K1)**0.5 # This is the damping
K2=0. # This is like a mass correction. ... | 19 | 103 | 0.626469 | import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
import scipy.stats as stats
bbar=0.2
abar=0.1
K1=2. #K0=5.
K0=(4.*K1)**0.5 # This is the damping
K2=0. # This is like a mass correction.
mu=0.
var = 0.0001
sigma= var**0.5
v_error=[]
v_PV=[]
END=100
#initializations
Dt=.2
p_error=... | true | true |
f74e3ca1802181eb51e28241cd708be18dda9632 | 4,055 | py | Python | homeassistant/components/rachio/binary_sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-01-21T18:09:09.000Z | 2022-01-17T08:06:03.000Z | homeassistant/components/rachio/binary_sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | homeassistant/components/rachio/binary_sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Integration with the Rachio Iro sprinkler system controller."""
from abc import abstractmethod
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.helpers.dispatcher import dispatcher_connect
from . import (
DOMAIN as DOMAIN_RACHIO,
KEY_DEVICE_ID,
KEY... | 31.679688 | 88 | 0.653761 | from abc import abstractmethod
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.helpers.dispatcher import dispatcher_connect
from . import (
DOMAIN as DOMAIN_RACHIO,
KEY_DEVICE_ID,
KEY_STATUS,
KEY_SUBTYPE,
SIGNAL_RACHIO_CONTROLLER_UPDATE,
... | true | true |
f74e3d42a81f7e0ae4fd18bac20ba5da733ecf2d | 234 | py | Python | web/server.py | yvanwangl/pythonLesson | 5b3892465a321b9f749ffda623f5871656bde608 | [
"MIT"
] | null | null | null | web/server.py | yvanwangl/pythonLesson | 5b3892465a321b9f749ffda623f5871656bde608 | [
"MIT"
] | null | null | null | web/server.py | yvanwangl/pythonLesson | 5b3892465a321b9f749ffda623f5871656bde608 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
from hello import application
http_server = make_server('', 8080, application)
print('Server on port 8080...')
http_server.serve_forever()
| 23.4 | 48 | 0.747863 |
from wsgiref.simple_server import make_server
from hello import application
http_server = make_server('', 8080, application)
print('Server on port 8080...')
http_server.serve_forever()
| true | true |
f74e3d831fbdb284a86e5b5d3abb3ddc063ebcbb | 2,919 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_11_01/models/backend_address_pool.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2018_11_01/models/backend_address_pool.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2018_11_01/models/backend_address_pool.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 42.304348 | 128 | 0.654676 |
from .sub_resource import SubResource
class BackendAddressPool(SubResource):
_validation = {
'backend_ip_configurations': {'readonly': True},
'load_balancing_rules': {'readonly': True},
'outbound_rule': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type':... | true | true |
f74e3e951df7d5135ceb0e05fab862538a9570d8 | 5,413 | py | Python | rule_30/rule_30.py | warwickdatascience/podcast-animations | b2b477ab6f2fe220715a95bb850c89501ed3d08b | [
"MIT"
] | null | null | null | rule_30/rule_30.py | warwickdatascience/podcast-animations | b2b477ab6f2fe220715a95bb850c89501ed3d08b | [
"MIT"
] | 1 | 2020-06-06T11:14:29.000Z | 2020-06-06T11:14:29.000Z | rule_30/rule_30.py | warwickdatascience/podcast-animations | b2b477ab6f2fe220715a95bb850c89501ed3d08b | [
"MIT"
] | null | null | null | """Generate an animation of the cellular automaton Rule 30."""
import json
import os
import pathlib
import shutil
import subprocess
import tempfile
import colour
import cv2
import imageio
import numpy as np
import scipy.signal as sg
import tqdm
# Global parameters
CONFIG_PATH = 'config/full.json'
FFMPEG_PATH = '/usr... | 32.413174 | 78 | 0.56974 |
import json
import os
import pathlib
import shutil
import subprocess
import tempfile
import colour
import cv2
import imageio
import numpy as np
import scipy.signal as sg
import tqdm
CONFIG_PATH = 'config/full.json'
FFMPEG_PATH = '/usr/bin/ffmpeg'
with open(CONFIG_PATH) as f:
config = json.load(f)
VIDEO_WIDT... | true | true |
f74e3f79d9032c8e99379ec9e0f557b803ec660a | 28,606 | py | Python | bokeh/document/events.py | dkapitan/bokeh | d518cecd1d9919db49e3c0033e8c1b89db9965bf | [
"BSD-3-Clause"
] | 1 | 2020-03-12T07:02:04.000Z | 2020-03-12T07:02:04.000Z | bokeh/document/events.py | dkapitan/bokeh | d518cecd1d9919db49e3c0033e8c1b89db9965bf | [
"BSD-3-Clause"
] | 1 | 2021-05-11T04:37:17.000Z | 2021-05-11T04:37:17.000Z | bokeh/document/events.py | dkapitan/bokeh | d518cecd1d9919db49e3c0033e8c1b89db9965bf | [
"BSD-3-Clause"
] | 1 | 2020-03-06T07:38:50.000Z | 2020-03-06T07:38:50.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 33.973872 | 121 | 0.561456 |
import logging log = logging.getLogger(__name__)
from ..util.dependencies import import_optional
pd = import_optional('pandas')
__all__ = (
'ColumnDataChangedEvent',
'ColumnsStreamedEvent',
'ColumnsPatchedEvent',
'DocumentChangedEvent',
'DocumentPatchedEvent',
'ModelChangedEvent',
'Roo... | true | true |
f74e40bb5b3e854e4af37dee8a405af867555f4b | 6,389 | py | Python | pose_camera_rpi.py | GrauleM/project-posenet | 4f9cb6bcf227e1203211823b2af99c463557a1b3 | [
"Apache-2.0"
] | null | null | null | pose_camera_rpi.py | GrauleM/project-posenet | 4f9cb6bcf227e1203211823b2af99c463557a1b3 | [
"Apache-2.0"
] | null | null | null | pose_camera_rpi.py | GrauleM/project-posenet | 4f9cb6bcf227e1203211823b2af99c463557a1b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.029762 | 98 | 0.669432 |
import argparse
import collections
from functools import partial
import re
import time
import numpy as np
from PIL import Image
import svgwrite
import gstreamer_rpi as gstreamer
from pose_engine import PoseEngine
from pose_engine import KeypointType
EDGES = (
(KeypointType.NOSE, KeypointType.LEFT_EYE),
(Key... | true | true |
f74e413462485792cfeac1ed30e015ec7d596664 | 2,273 | py | Python | arjuna-samples/arjex/test/pkg/webui_adv/check_webuiadv_09_element_waiters.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna-samples/arjex/test/pkg/webui_adv/check_webuiadv_09_element_waiters.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | arjuna-samples/arjex/test/pkg/webui_adv/check_webuiadv_09_element_waiters.py | ChandraMouliDisturbs/arjuna | 4965622fbb01a5e5b6459110c413accc5c483424 | [
"Apache-2.0"
] | null | null | null | # This file is a part of Arjuna
# Copyright 2015-2020 Rahul Verma
# Website: www.RahulVerma.net
# 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... | 33.925373 | 93 | 0.721953 |
from arjuna import *
@test
def check_wait_until_absent_nested(request, logged_in_wordpress):
logged_in_wordpress.element(id="adminmenu").wait_until_absent(id="something")
try:
logged_in_wordpress.element(id="adminmenu").wait_until_absent(tag="div")
except GuiWidgetPresentError as... | true | true |
f74e4147f8144c737f97f0be1783911d96354916 | 897 | py | Python | to_do_backend/to_do_backend/urls.py | paul3bin/To-Do-App | 0e09c5d095448bcd3cfa467b2cef27df2ec30148 | [
"MIT"
] | null | null | null | to_do_backend/to_do_backend/urls.py | paul3bin/To-Do-App | 0e09c5d095448bcd3cfa467b2cef27df2ec30148 | [
"MIT"
] | null | null | null | to_do_backend/to_do_backend/urls.py | paul3bin/To-Do-App | 0e09c5d095448bcd3cfa467b2cef27df2ec30148 | [
"MIT"
] | null | null | null | """to_do_backend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 37.375 | 77 | 0.724638 | from django.contrib import admin
from django.urls import path
from django.conf.urls import include
from rest_framework.authtoken.views import obtain_auth_token
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('to_do_api.urls')),
] | true | true |
f74e41f99c50c003c5c9d818a814e337988baeda | 5,504 | py | Python | src/Menus/Edit_menu.py | myhumankit/ESP32_IDE_accessible | 5262a5dd106f3f52a374a6c1ef68ff53d8847001 | [
"MIT"
] | 1 | 2020-07-27T19:32:56.000Z | 2020-07-27T19:32:56.000Z | src/Menus/Edit_menu.py | myhumankit/Blind_IDE | 5262a5dd106f3f52a374a6c1ef68ff53d8847001 | [
"MIT"
] | null | null | null | src/Menus/Edit_menu.py | myhumankit/Blind_IDE | 5262a5dd106f3f52a374a6c1ef68ff53d8847001 | [
"MIT"
] | null | null | null | """
Module wich contains the EditMenu class and some functions linked to this menu
"""
import wx
import sys
import os
from api.api_pyflakes import main as CheckPySyntax
from Utils.voice_synthese import my_speak
class EditMenu(wx.Menu):
"""Inits a instance of a wx.Menu to create a Theme menu and
his butt... | 30.577778 | 87 | 0.539426 | import wx
import sys
import os
from api.api_pyflakes import main as CheckPySyntax
from Utils.voice_synthese import my_speak
class EditMenu(wx.Menu):
def __init__(self, frame):
wx.Menu.__init__(self, "Edit")
self.frame = frame
self.item_list = []
self.Append(wx.ID_COPY, "&Copy\t... | true | true |
f74e42266f80728725ddf096c9a46a217d967294 | 1,950 | py | Python | rfflearn/explainer/permutation.py | tiskw/random-fourier-features | 4a12185e44d1f9aba594f8a7569042e73675d6cd | [
"MIT"
] | 24 | 2021-02-14T12:05:27.000Z | 2022-03-12T07:29:25.000Z | rfflearn/explainer/permutation.py | tiskw/RandomFourierFeatures | 4a12185e44d1f9aba594f8a7569042e73675d6cd | [
"MIT"
] | 1 | 2021-07-19T09:53:15.000Z | 2021-10-03T03:04:30.000Z | rfflearn/explainer/permutation.py | tiskw/random-fourier-features | 4a12185e44d1f9aba594f8a7569042e73675d6cd | [
"MIT"
] | 6 | 2021-03-07T12:08:34.000Z | 2022-03-26T09:47:36.000Z | #!/usr/bin/env python3
#
# Wrapper functions for the permutation feature importance.
#
##################################################### SOURCE START #####################################################
import numpy as np
import matplotlib.pyplot as mpl
import sklearn.inspection
### Calculate permutation impor... | 39 | 120 | 0.675897 |
import numpy as np
import matplotlib.pyplot as mpl
import sklearn.inspection
def permutation_feature_importance(model, Xs, ys, **kwargs):
permutation_importance = sklearn.inspection.permutation_importance(model, Xs, ys, **kwargs)
setattr(model, "feature_importances_", permutation_importance.im... | true | true |
f74e4287c01a51060cf687db264b8e8ef4e28055 | 3,974 | py | Python | src/bintools/run/utils.py | Simonll/bintools | 009c9616545f3fc51b897da9bc53f35fb23c99eb | [
"MIT"
] | null | null | null | src/bintools/run/utils.py | Simonll/bintools | 009c9616545f3fc51b897da9bc53f35fb23c99eb | [
"MIT"
] | null | null | null | src/bintools/run/utils.py | Simonll/bintools | 009c9616545f3fc51b897da9bc53f35fb23c99eb | [
"MIT"
] | null | null | null | import os
import shlex
import subprocess
import sys
from textwrap import dedent
from typing import Any
from typing import Optional
from typing import Tuple
def joint_kwargs(**kwargs) -> str:
return " ".join([k + " " + v for k, v in kwargs.items()])
def sub(
cmd: str, cwd: Optional[str] = None, stdout: bool ... | 30.806202 | 109 | 0.623805 | import os
import shlex
import subprocess
import sys
from textwrap import dedent
from typing import Any
from typing import Optional
from typing import Tuple
def joint_kwargs(**kwargs) -> str:
return " ".join([k + " " + v for k, v in kwargs.items()])
def sub(
cmd: str, cwd: Optional[str] = None, stdout: bool ... | true | true |
f74e437f9e5973cfaef9f114536318cc5cbc3222 | 971 | py | Python | fibber/metrics/distance/self_bleu_metric.py | stungkit/fibber | 115bc594d69cfd5d48c63450c5f3a2c08f463ba3 | [
"MIT"
] | null | null | null | fibber/metrics/distance/self_bleu_metric.py | stungkit/fibber | 115bc594d69cfd5d48c63450c5f3a2c08f463ba3 | [
"MIT"
] | null | null | null | fibber/metrics/distance/self_bleu_metric.py | stungkit/fibber | 115bc594d69cfd5d48c63450c5f3a2c08f463ba3 | [
"MIT"
] | null | null | null | """This metric computes the embedding similarity using SBERT model."""
from nltk import word_tokenize
from nltk.translate import bleu_score
from fibber import log
from fibber.metrics.metric_base import MetricBase
logger = log.setup_custom_logger(__name__)
class SelfBleuMetric(MetricBase):
"""This metric compu... | 30.34375 | 91 | 0.69104 |
from nltk import word_tokenize
from nltk.translate import bleu_score
from fibber import log
from fibber.metrics.metric_base import MetricBase
logger = log.setup_custom_logger(__name__)
class SelfBleuMetric(MetricBase):
def __init__(self, **kargs):
super(SelfBleuMetric, self).__init__(**kargs)
de... | true | true |
f74e45d31160ed021813cc4b786b87dcea991015 | 3,513 | py | Python | tests/nlu/example_component.py | praneethgb/rasa | 5bf227f165d0b041a367d2c0bbf712ebb6a54792 | [
"Apache-2.0"
] | 8 | 2020-09-16T17:22:13.000Z | 2022-02-01T00:11:30.000Z | tests/nlu/example_component.py | praneethgb/rasa | 5bf227f165d0b041a367d2c0bbf712ebb6a54792 | [
"Apache-2.0"
] | 216 | 2020-09-20T13:05:58.000Z | 2022-03-28T12:10:24.000Z | tests/nlu/example_component.py | praneethgb/rasa | 5bf227f165d0b041a367d2c0bbf712ebb6a54792 | [
"Apache-2.0"
] | 1 | 2021-07-19T12:59:26.000Z | 2021-07-19T12:59:26.000Z | import typing
from typing import Any, Optional, Text, Dict, List, Type
from rasa.nlu.components import Component
from rasa.nlu.config import RasaNLUModelConfig
from rasa.shared.nlu.training_data.training_data import TrainingData
from rasa.shared.nlu.training_data.message import Message
if typing.TYPE_CHECKING:
fr... | 36.59375 | 85 | 0.6846 | import typing
from typing import Any, Optional, Text, Dict, List, Type
from rasa.nlu.components import Component
from rasa.nlu.config import RasaNLUModelConfig
from rasa.shared.nlu.training_data.training_data import TrainingData
from rasa.shared.nlu.training_data.message import Message
if typing.TYPE_CHECKING:
fr... | true | true |
f74e45d421222781a4164c6436759f2d21e494b7 | 936 | pyde | Python | mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pyde | timgates42/processing.py | 78a237922c2a928b83f4ad579dbf8d32c0099890 | [
"Apache-2.0"
] | 1,224 | 2015-01-01T22:09:23.000Z | 2022-03-29T19:43:56.000Z | mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pyde | timgates42/processing.py | 78a237922c2a928b83f4ad579dbf8d32c0099890 | [
"Apache-2.0"
] | 253 | 2015-01-14T03:45:51.000Z | 2022-02-08T01:18:19.000Z | mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pyde | timgates42/processing.py | 78a237922c2a928b83f4ad579dbf8d32c0099890 | [
"Apache-2.0"
] | 225 | 2015-01-13T18:38:33.000Z | 2022-03-30T20:27:39.000Z | """
PolygonPShapeOOP.
Wrapping a PShape inside a custom class
and demonstrating how we can have a multiple objects each
using the same PShape.
"""
from polygon import Polygon
# A list of objects
polygons = []
def setup():
size(640, 360, P2D)
smooth()
# Make a PShape.
star = createShape()
star.b... | 20.347826 | 57 | 0.623932 | from polygon import Polygon
polygons = []
def setup():
size(640, 360, P2D)
smooth()
star = createShape()
star.beginShape()
star.noStroke()
star.fill(0, 127)
star.vertex(0, -50)
star.vertex(14, -20)
star.vertex(47, -15)
star.vertex(23, 7)
star.vertex(29, 40)
star.ver... | true | true |
f74e463fe020a1edd5135f5d6c3ddb0ec23e8fb1 | 10,517 | py | Python | python/randall/alife_randall_checkout/randallai/AI/logos.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | 3 | 2015-11-24T17:06:58.000Z | 2018-05-01T14:03:57.000Z | python/randall/alife_randall_checkout/randallai/AI/logos.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | null | null | null | python/randall/alife_randall_checkout/randallai/AI/logos.py | josephlewis42/personal_codebase | aa0fff9a908ab90bc78d24aa69d1b91163c35314 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
'''
The logos module provides a kind of decision making process center.
It has hints of imagination and logic.
Copyright (c) 2011 Joseph Lewis <joehms22@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Licens... | 36.517361 | 137 | 0.609204 | '''
The logos module provides a kind of decision making process center.
It has hints of imagination and logic.
Copyright (c) 2011 Joseph Lewis <joehms22@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... | false | true |
f74e46f741edb463653051729f68cbc2c4f135f4 | 28,151 | py | Python | apyec/note.py | HazenBabcock/APyEC | 2377e4e6ae242ffc324487112541f1a2cf8b499c | [
"MIT"
] | 3 | 2015-09-30T14:08:02.000Z | 2021-02-18T02:49:01.000Z | apyec/note.py | HazenBabcock/APyEC | 2377e4e6ae242ffc324487112541f1a2cf8b499c | [
"MIT"
] | 4 | 2015-10-01T17:24:36.000Z | 2016-02-18T16:27:25.000Z | apyec/note.py | HazenBabcock/APyEC | 2377e4e6ae242ffc324487112541f1a2cf8b499c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
.. module:: note
:synopsis: The Note class.
"""
import datetime
import glob
import os
import uuid
import shutil
from PyQt4 import QtCore, QtGui
from xml.etree import ElementTree
import converters
import logger
import misc
class NoteContent(object):
"""
The content, keywords, a... | 35.321205 | 121 | 0.604739 | """
.. module:: note
:synopsis: The Note class.
"""
import datetime
import glob
import os
import uuid
import shutil
from PyQt4 import QtCore, QtGui
from xml.etree import ElementTree
import converters
import logger
import misc
class NoteContent(object):
"""
The content, keywords, attachments, etc.. of a... | false | true |
f74e47ac3750dbdabc63ccedaf8beeea49dfe233 | 1,008 | py | Python | proposals/mixins.py | mindruion/test | d27ef1caf8f76aead934bc83be7729f79a4be503 | [
"MIT"
] | null | null | null | proposals/mixins.py | mindruion/test | d27ef1caf8f76aead934bc83be7729f79a4be503 | [
"MIT"
] | null | null | null | proposals/mixins.py | mindruion/test | d27ef1caf8f76aead934bc83be7729f79a4be503 | [
"MIT"
] | null | null | null | from braces.views import UserFormKwargsMixin
from .models import Proposal
from .forms import ProposalForm
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
class ProposalMixin(UserFormKwargsMixin):
model = Proposal
form_class = ProposalForm
success_message = _('Studi... | 32.516129 | 88 | 0.696429 | from braces.views import UserFormKwargsMixin
from .models import Proposal
from .forms import ProposalForm
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
class ProposalMixin(UserFormKwargsMixin):
model = Proposal
form_class = ProposalForm
success_message = _('Studi... | true | true |
f74e47f4a7115c2c613150309807e58e251b5e01 | 2,531 | py | Python | setup.py | WangYongzhao/OpenNMT-tf | b1c51e8a3560aa96c3359c5dfa3312d9771c3a32 | [
"MIT"
] | null | null | null | setup.py | WangYongzhao/OpenNMT-tf | b1c51e8a3560aa96c3359c5dfa3312d9771c3a32 | [
"MIT"
] | null | null | null | setup.py | WangYongzhao/OpenNMT-tf | b1c51e8a3560aa96c3359c5dfa3312d9771c3a32 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
tests_require = [
"parameterized",
"nose2"
]
setup(
name="OpenNMT-tf",
version="1.22.2",
license="MIT",
description="Neural machine translation and sequence learning using TensorFlow",
author="OpenNMT",
author_email="guillaume.klein@systrangr... | 36.681159 | 84 | 0.60964 | from setuptools import setup, find_packages
tests_require = [
"parameterized",
"nose2"
]
setup(
name="OpenNMT-tf",
version="1.22.2",
license="MIT",
description="Neural machine translation and sequence learning using TensorFlow",
author="OpenNMT",
author_email="guillaume.klein@systrangr... | true | true |
f74e4add2156217006aaffa7dae89f91121e8f04 | 50,388 | py | Python | lingvo/core/quant_utils.py | lukasbindreiter/lingvo | d6f2e6901fadc8440a9e6222ac54b68a8b6faf02 | [
"Apache-2.0"
] | 1 | 2021-05-10T10:47:28.000Z | 2021-05-10T10:47:28.000Z | lingvo/core/quant_utils.py | lukasbindreiter/lingvo | d6f2e6901fadc8440a9e6222ac54b68a8b6faf02 | [
"Apache-2.0"
] | null | null | null | lingvo/core/quant_utils.py | lukasbindreiter/lingvo | d6f2e6901fadc8440a9e6222ac54b68a8b6faf02 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2018 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 ... | 34.991667 | 80 | 0.675875 |
import enum
import lingvo.compat as tf
from lingvo.core import base_layer
from lingvo.core import hyperparams
from lingvo.core import py_utils
from lingvo.core import summary_utils
import numpy as np
class QuantizableLayer(base_layer.BaseLayer):
@classmethod
def Params(cls):
p = super().Params()
p.Defin... | true | true |
f74e4d1bd89e243e3b4c3a92e6d389f2a7f3b160 | 647 | py | Python | bin/tidy_json.py | cleiver/codeandtalk.com | 132cadddcfc97924969af68130baea2c3abd18cb | [
"Apache-2.0"
] | 60 | 2016-11-24T13:38:03.000Z | 2022-03-23T06:57:13.000Z | bin/tidy_json.py | cleiver/codeandtalk.com | 132cadddcfc97924969af68130baea2c3abd18cb | [
"Apache-2.0"
] | 384 | 2016-11-24T13:50:58.000Z | 2022-03-30T14:57:35.000Z | bin/tidy_json.py | cleiver/codeandtalk.com | 132cadddcfc97924969af68130baea2c3abd18cb | [
"Apache-2.0"
] | 167 | 2016-11-24T10:20:25.000Z | 2022-03-25T10:23:38.000Z | #!/usr/bin/env python3
import json
import glob
# format the json files
def tidy(filename):
with open(filename) as fh:
data = json.load(fh)
with open(filename, 'w') as fh:
json.dump(data, fh, sort_keys=True, indent=4, separators=(',', ': '), ensure_ascii=False)
for filename in glob.glob("data/... | 22.310345 | 97 | 0.661515 | import json
import glob
def tidy(filename):
with open(filename) as fh:
data = json.load(fh)
with open(filename, 'w') as fh:
json.dump(data, fh, sort_keys=True, indent=4, separators=(',', ': '), ensure_ascii=False)
for filename in glob.glob("data/*.json"):
tidy(filename)
for filename in g... | true | true |
f74e4d30d9dfd6fb1af0d9bdf8c703b172fb6fa1 | 791 | py | Python | SprintNour/SprintChallenge/acme_test.py | nouretienne/DS-Unit-3-Sprint-1-Software-Engineering | 558be4fb459622448d6773824cbb825076bc9786 | [
"MIT"
] | null | null | null | SprintNour/SprintChallenge/acme_test.py | nouretienne/DS-Unit-3-Sprint-1-Software-Engineering | 558be4fb459622448d6773824cbb825076bc9786 | [
"MIT"
] | null | null | null | SprintNour/SprintChallenge/acme_test.py | nouretienne/DS-Unit-3-Sprint-1-Software-Engineering | 558be4fb459622448d6773824cbb825076bc9786 | [
"MIT"
] | null | null | null | import unittest
from acme import Product
from acme_report import generate_products, adj, name
class AcmeProductTests(unittest.TestCase):
"""Making sure Acme products are the tops!"""
def test_default_product_price(self):
"""Test default product price being 10."""
prod = Product('Test Product')... | 31.64 | 87 | 0.681416 | import unittest
from acme import Product
from acme_report import generate_products, adj, name
class AcmeProductTests(unittest.TestCase):
def test_default_product_price(self):
prod = Product('Test Product')
self.assertEqual(prod.price, 10)
def test_default_product_flammability(self):
p... | true | true |
f74e4dbe259e2d5c38258b49a5414f2bbec64389 | 1,051 | py | Python | tools/chrome_remote_control/chrome_remote_control/util.py | junmin-zhu/chromium-rivertrail | eb1a57aca71fe68d96e48af8998dcfbe45171ee1 | [
"BSD-3-Clause"
] | 5 | 2018-03-10T13:08:42.000Z | 2021-07-26T15:02:11.000Z | tools/chrome_remote_control/chrome_remote_control/util.py | sanyaade-mobiledev/chromium.src | d496dfeebb0f282468827654c2b3769b3378c087 | [
"BSD-3-Clause"
] | 1 | 2015-07-21T08:02:01.000Z | 2015-07-21T08:02:01.000Z | tools/chrome_remote_control/chrome_remote_control/util.py | jianglong0156/chromium.src | d496dfeebb0f282468827654c2b3769b3378c087 | [
"BSD-3-Clause"
] | 6 | 2016-11-14T10:13:35.000Z | 2021-01-23T15:29:53.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import inspect
import time
class TimeoutException(Exception):
pass
def WaitFor(condition,
timeout, poll_interval=0.1,
pass_tim... | 31.848485 | 72 | 0.656518 | import inspect
import time
class TimeoutException(Exception):
pass
def WaitFor(condition,
timeout, poll_interval=0.1,
pass_time_left_to_func=False):
assert isinstance(condition, type(lambda: None)) start_time = time.time()
while True:
if pass_time_left_to_func:
res = conditi... | true | true |
f74e4de74bac14e6a01875722a7960c0647721ad | 3,157 | py | Python | nipy/neurospin/register/tests/test_iconic_matcher.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | 1 | 2015-08-22T16:14:45.000Z | 2015-08-22T16:14:45.000Z | nipy/neurospin/register/tests/test_iconic_matcher.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | null | null | null | nipy/neurospin/register/tests/test_iconic_matcher.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from nipy.testing import assert_equal, assert_almost_equal, assert_raises
import numpy as np
from nipy.neurospin.register.iconic_matcher import IconicMatcher
class Image(object):
"""
Empty object to easily create image objects independently from any I/O package.
"""
def __init... | 30.95098 | 106 | 0.673741 |
from nipy.testing import assert_equal, assert_almost_equal, assert_raises
import numpy as np
from nipy.neurospin.register.iconic_matcher import IconicMatcher
class Image(object):
def __init__(self, array, toworld=None, voxsize=[1, 1, 1]):
self.array = array
self.voxsize = np.asarray(voxsize)
... | true | true |
f74e4e0148c96a7dc7719efca3ce333f408818de | 8,459 | py | Python | enaml/widgets/constraints_widget.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | null | null | null | enaml/widgets/constraints_widget.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | null | null | null | enaml/widgets/constraints_widget.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | null | null | null | #------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | 36.938865 | 79 | 0.641092 | from atom.api import (
DefaultValue, Enum, Typed, List, Constant, ForwardTyped, observe
)
from casuarius import ConstraintVariable
from enaml.core.declarative import d_
from enaml.layout.ab_constrainable import ABConstrainable
from .widget import Widget, ProxyWidget
PolicyEnum = Enum('ignore', 'weak', 'medium'... | true | true |
f74e4fb729c94104b2a30b43aa41b1e48fab2f7d | 771 | py | Python | cea/interfaces/dashboard/api/utils.py | architecture-building-systems/cea-toolbox | bfec7ecb4b242449ab8796a1e8ce68c05c35f1d6 | [
"MIT"
] | null | null | null | cea/interfaces/dashboard/api/utils.py | architecture-building-systems/cea-toolbox | bfec7ecb4b242449ab8796a1e8ce68c05c35f1d6 | [
"MIT"
] | null | null | null | cea/interfaces/dashboard/api/utils.py | architecture-building-systems/cea-toolbox | bfec7ecb4b242449ab8796a1e8ce68c05c35f1d6 | [
"MIT"
] | null | null | null |
from flask import current_app
import cea.config
import cea.inputlocator
def deconstruct_parameters(p: cea.config.Parameter):
params = {'name': p.name, 'type': p.typename, 'help': p.help}
try:
params["value"] = p.get()
except cea.ConfigError as e:
print(e)
params["value"] = ""
... | 29.653846 | 65 | 0.648508 |
from flask import current_app
import cea.config
import cea.inputlocator
def deconstruct_parameters(p: cea.config.Parameter):
params = {'name': p.name, 'type': p.typename, 'help': p.help}
try:
params["value"] = p.get()
except cea.ConfigError as e:
print(e)
params["value"] = ""
... | true | true |
f74e50eb4c26ec7e7e698613133d8b120eed6eaf | 26,227 | py | Python | scripts/tests/unit/test_schema_loader.py | dstepanic17/ecs | c84e5a7d277cce68fb9102580a6fef92be5ad432 | [
"Apache-2.0"
] | null | null | null | scripts/tests/unit/test_schema_loader.py | dstepanic17/ecs | c84e5a7d277cce68fb9102580a6fef92be5ad432 | [
"Apache-2.0"
] | null | null | null | scripts/tests/unit/test_schema_loader.py | dstepanic17/ecs | c84e5a7d277cce68fb9102580a6fef92be5ad432 | [
"Apache-2.0"
] | null | null | null | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 34.87633 | 120 | 0.358638 |
import mock
import os
import pprint
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
from schema import loader
class TestSchemaLoader(unittest.TestCase):
def setUp(self):
self.maxDiff = None
@mock.patch('schema.loader.warn')
def test_eval_globs(self... | true | true |
f74e51f8dd0446c74b623504dee8c8c39f6a8dc5 | 13,322 | py | Python | ekorpkit/io/archive.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | 4 | 2022-02-26T10:54:16.000Z | 2022-02-26T11:01:56.000Z | ekorpkit/io/archive.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | 1 | 2022-03-25T06:37:12.000Z | 2022-03-25T06:45:53.000Z | ekorpkit/io/archive.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | null | null | null | import os
import zstandard
import orjson as json
import time
import tarfile
import codecs
from functools import reduce
import jsonlines
import io
from zipfile import ZipFile
import gzip
from math import ceil
import mmap
import multiprocessing as mp
from pathlib import Path
VALID_EXTENSIONS = [
"openwebtext.tar.xz"... | 29.803132 | 106 | 0.535805 | import os
import zstandard
import orjson as json
import time
import tarfile
import codecs
from functools import reduce
import jsonlines
import io
from zipfile import ZipFile
import gzip
from math import ceil
import mmap
import multiprocessing as mp
from pathlib import Path
VALID_EXTENSIONS = [
"openwebtext.tar.xz"... | true | true |
f74e536b351a116f92a8e455b5929f222624ae0f | 201 | py | Python | examples/attributes/Person.py | irmen/Pyro3 | 5bd531088d9a11ec83556a0429f18df6cb5cd437 | [
"MIT"
] | 3 | 2018-01-13T20:50:41.000Z | 2020-02-24T13:35:08.000Z | examples/attributes/Person.py | irmen/Pyro3 | 5bd531088d9a11ec83556a0429f18df6cb5cd437 | [
"MIT"
] | null | null | null | examples/attributes/Person.py | irmen/Pyro3 | 5bd531088d9a11ec83556a0429f18df6cb5cd437 | [
"MIT"
] | 6 | 2015-03-21T20:34:05.000Z | 2021-06-08T04:04:33.000Z | ####### Special object
class Person(object):
def __init__(self, name, age):
self.name=name
self.age=age
def getName(self):
return 'My name is '+self.name
def getAge(self):
return self.age
| 16.75 | 32 | 0.676617 |
class Person(object):
def __init__(self, name, age):
self.name=name
self.age=age
def getName(self):
return 'My name is '+self.name
def getAge(self):
return self.age
| true | true |
f74e53907c7b1cd5c5d81e4fde1e9824a67a8ab2 | 10,092 | py | Python | src/reporter/reporter.py | fisuda/ngsi-timeseries-api | 541df6b62afd06131c905e1bcec60e5d000cc54d | [
"MIT"
] | null | null | null | src/reporter/reporter.py | fisuda/ngsi-timeseries-api | 541df6b62afd06131c905e1bcec60e5d000cc54d | [
"MIT"
] | null | null | null | src/reporter/reporter.py | fisuda/ngsi-timeseries-api | 541df6b62afd06131c905e1bcec60e5d000cc54d | [
"MIT"
] | null | null | null | """
The reporter is the service responsible for handling NGSI notifications,
validating them, and feeding the corresponding updates to the translator.
The reporter needs to know the form of the entity (i.e, name and types of its
attributes). There are two approaches:
1 - Clients tell reporter which entities they c... | 33.417219 | 102 | 0.656163 |
from flask import has_request_context, request
from geocoding import geocoding
from geocoding.factory import get_geo_cache, is_geo_coding_available
from requests import RequestException
from translators.sql_translator import SQLTranslator
from translators.factory import translator_for
from utils.common import iter_ent... | true | true |
f74e5391f3563910f991b32e3328fda35ed0a6e0 | 1,124 | py | Python | app/search.py | AInursery/george | 6285f52750aca14b8ea85d82349ee0907eb04867 | [
"Apache-1.1"
] | 1 | 2015-05-26T19:58:10.000Z | 2015-05-26T19:58:10.000Z | app/search.py | AInursery/george | 6285f52750aca14b8ea85d82349ee0907eb04867 | [
"Apache-1.1"
] | null | null | null | app/search.py | AInursery/george | 6285f52750aca14b8ea85d82349ee0907eb04867 | [
"Apache-1.1"
] | null | null | null | from elasticsearch import Elasticsearch
from pprint import pprint as pp
es = Elasticsearch()
INDEX = "meme-index"
TYPE = "meme"
def submit(id, doc):
res = es.index(index=INDEX, doc_type=TYPE, id=id, body=doc)
if res['created']:
return True
def search(query):
es.indices.refresh(index=INDEX)
... | 22.48 | 70 | 0.542705 | from elasticsearch import Elasticsearch
from pprint import pprint as pp
es = Elasticsearch()
INDEX = "meme-index"
TYPE = "meme"
def submit(id, doc):
res = es.index(index=INDEX, doc_type=TYPE, id=id, body=doc)
if res['created']:
return True
def search(query):
es.indices.refresh(index=INDEX)
... | true | true |
f74e540cf79aed82b798f402a955f469b9039add | 1,932 | py | Python | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/DeleteDeviceRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/DeleteDeviceRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/DeleteDeviceRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"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... | 34.5 | 74 | 0.763458 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkiot.endpoint import endpoint_data
class DeleteDeviceRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'DeleteDevice')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map", end... | true | true |
f74e54467cd318f70cb75b4a5b4498828ae14e14 | 11,913 | py | Python | yolo_v4.py | RitwickGhosh/DeepSORT-YOLOv4-TensorRT-OpenVINO | 104e0433c56cebb7db503e23aaec9e7f1d7fdd3a | [
"MIT"
] | null | null | null | yolo_v4.py | RitwickGhosh/DeepSORT-YOLOv4-TensorRT-OpenVINO | 104e0433c56cebb7db503e23aaec9e7f1d7fdd3a | [
"MIT"
] | null | null | null | yolo_v4.py | RitwickGhosh/DeepSORT-YOLOv4-TensorRT-OpenVINO | 104e0433c56cebb7db503e23aaec9e7f1d7fdd3a | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
slim = tf.contrib.slim
_BATCH_NORM_DECAY = 0.9
_BATCH_NORM_EPSILON = 1e-05
_LEAKY_RELU = 0.1
_ANCHORS = [(12, 16), (19, 36), (40, 28),
(36, 75), (76, 55), (72, 146),
(142, 110), (192, 243), (459, 401)]
@tf.contrib.framework.add_arg_scope
def _fixed_p... | 37.93949 | 110 | 0.627382 | import numpy as np
import tensorflow as tf
slim = tf.contrib.slim
_BATCH_NORM_DECAY = 0.9
_BATCH_NORM_EPSILON = 1e-05
_LEAKY_RELU = 0.1
_ANCHORS = [(12, 16), (19, 36), (40, 28),
(36, 75), (76, 55), (72, 146),
(142, 110), (192, 243), (459, 401)]
@tf.contrib.framework.add_arg_scope
def _fixed_p... | true | true |
f74e54b6615bab2166cb9b4829f9b1aa026c8a42 | 6,169 | py | Python | coredis/response/_callbacks/streams.py | alisaifee/coredis | e72f5d7c665b53e6a1d41e1a7fb9e400858a8b19 | [
"MIT"
] | 9 | 2022-01-07T07:42:08.000Z | 2022-03-21T15:54:09.000Z | coredis/response/_callbacks/streams.py | alisaifee/coredis | e72f5d7c665b53e6a1d41e1a7fb9e400858a8b19 | [
"MIT"
] | 30 | 2022-01-15T23:33:36.000Z | 2022-03-30T22:39:53.000Z | coredis/response/_callbacks/streams.py | alisaifee/coredis | e72f5d7c665b53e6a1d41e1a7fb9e400858a8b19 | [
"MIT"
] | 3 | 2022-01-13T06:11:13.000Z | 2022-02-21T11:19:33.000Z | from __future__ import annotations
from typing import Any
from coredis._utils import EncodingInsensitiveDict
from coredis.response._callbacks import ResponseCallback
from coredis.response._utils import flat_pairs_to_dict, flat_pairs_to_ordered_dict
from coredis.response.types import (
StreamEntry,
StreamInfo,... | 31 | 88 | 0.562004 | from __future__ import annotations
from typing import Any
from coredis._utils import EncodingInsensitiveDict
from coredis.response._callbacks import ResponseCallback
from coredis.response._utils import flat_pairs_to_dict, flat_pairs_to_ordered_dict
from coredis.response.types import (
StreamEntry,
StreamInfo,... | true | true |
f74e552246ac5d4490312f2c9daa9f681c80b3cc | 6,397 | py | Python | src/utils.py | zeddee/info_retrieve | b54f80e1124183221e509c88413a2afc6ff4fae6 | [
"Apache-2.0"
] | null | null | null | src/utils.py | zeddee/info_retrieve | b54f80e1124183221e509c88413a2afc6ff4fae6 | [
"Apache-2.0"
] | null | null | null | src/utils.py | zeddee/info_retrieve | b54f80e1124183221e509c88413a2afc6ff4fae6 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
def question_cleaner(df_query):
kb=([int(xx) for xx in (df_query[3].iloc[0]).split(' ')])
gt = [int(xx) for xx in (df_query[2].iloc[0]).split(' ')]
ct=0
negg=0
withans=[]
for ii in range(len(df_query))... | 44.423611 | 227 | 0.654682 | import pandas as pd
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
def question_cleaner(df_query):
kb=([int(xx) for xx in (df_query[3].iloc[0]).split(' ')])
gt = [int(xx) for xx in (df_query[2].iloc[0]).split(' ')]
ct=0
negg=0
withans=[]
for ii in range(len(df_query))... | true | true |
f74e562ae0d91712beb84c119101e3a84d2411e2 | 592 | py | Python | generate_uvm_regs.py | EngRaff92/RDL_REG_GEN | 1da36a247552217d009b41b035ddda742ad2aa3e | [
"MIT"
] | 2 | 2022-01-11T19:22:16.000Z | 2022-01-11T20:19:55.000Z | generate_uvm_regs.py | EngRaff92/RDL_REG_GEN | 1da36a247552217d009b41b035ddda742ad2aa3e | [
"MIT"
] | null | null | null | generate_uvm_regs.py | EngRaff92/RDL_REG_GEN | 1da36a247552217d009b41b035ddda742ad2aa3e | [
"MIT"
] | null | null | null | #!/opt/homebrew/bin/python3.9
import sys
from systemrdl import RDLCompiler, RDLCompileError
from peakrdl.uvm import UVMExporter
def export_uvm(obj):
exporter = UVMExporter()
exporter.export(root, "./output_all/reg_pkg.sv")
if __name__ == "__main__":
import sys
# Compile and elaborate files provided f... | 25.73913 | 64 | 0.684122 |
import sys
from systemrdl import RDLCompiler, RDLCompileError
from peakrdl.uvm import UVMExporter
def export_uvm(obj):
exporter = UVMExporter()
exporter.export(root, "./output_all/reg_pkg.sv")
if __name__ == "__main__":
import sys
input_files = sys.argv[1:]
rdlc = RDLCompiler()
try:
... | true | true |
f74e569bc48174f7e765e4c9e16bfbf19509fb49 | 50,162 | py | Python | core/domain/feedback_services_test.py | vddesai1871/oppia | d48ab80d62b7bc1684a798688b89f094a2f1b3d5 | [
"Apache-2.0"
] | 1 | 2019-01-31T18:48:50.000Z | 2019-01-31T18:48:50.000Z | core/domain/feedback_services_test.py | debck/oppia | 7126b42bf105724cb82dd2d4df377e7a35c3ca18 | [
"Apache-2.0"
] | null | null | null | core/domain/feedback_services_test.py | debck/oppia | 7126b42bf105724cb82dd2d4df377e7a35c3ca18 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Oppia 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 applicable ... | 43.057511 | 80 | 0.629819 |
import json
from core.domain import email_services
from core.domain import event_services
from core.domain import feedback_domain
from core.domain import feedback_jobs_continuous
from core.domain import feedback_services
from core.domain import subscription_services
from core.domain import user_services
from core.pla... | true | true |
f74e575da60ac8797ab0d807853be4861e22453f | 11,917 | py | Python | samples/ray_casting.py | mauri-medina/asciimatics | 2bf39ac7bde5f9bfcd4559476a72220949438629 | [
"Apache-2.0"
] | null | null | null | samples/ray_casting.py | mauri-medina/asciimatics | 2bf39ac7bde5f9bfcd4559476a72220949438629 | [
"Apache-2.0"
] | 1 | 2022-03-12T01:08:05.000Z | 2022-03-12T01:08:05.000Z | samples/ray_casting.py | cnheider/asciimatics | adcd94abc091ecde4c8742fd8dcced3121a3be5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from math import sin, cos, pi, copysign, floor
from asciimatics.effects import Effect
from asciimatics.event import KeyboardEvent
from asciimatics.exceptions import ResizeScreenError, StopApplication
from asciimatics.screen import Screen
from asciimatics.scene ... | 36.443425 | 103 | 0.556935 |
import sys
from math import sin, cos, pi, copysign, floor
from asciimatics.effects import Effect
from asciimatics.event import KeyboardEvent
from asciimatics.exceptions import ResizeScreenError, StopApplication
from asciimatics.screen import Screen
from asciimatics.scene import Scene
from asciimatics.widgets import Po... | true | true |
f74e58037d59f91e4df3b512c087e56d043bea03 | 173 | py | Python | src/driver/selenium.py | matanbroner/MyUCSCAPy | 362b702a4216e9add4de1f65f36a8408c2c1f351 | [
"MIT"
] | null | null | null | src/driver/selenium.py | matanbroner/MyUCSCAPy | 362b702a4216e9add4de1f65f36a8408c2c1f351 | [
"MIT"
] | null | null | null | src/driver/selenium.py | matanbroner/MyUCSCAPy | 362b702a4216e9add4de1f65f36a8408c2c1f351 | [
"MIT"
] | null | null | null | from selenium import webdriver
import chromedriver_binary
def generate_driver(config=None):
driver = webdriver.Chrome()
driver.implicitly_wait(15)
return driver | 24.714286 | 33 | 0.786127 | from selenium import webdriver
import chromedriver_binary
def generate_driver(config=None):
driver = webdriver.Chrome()
driver.implicitly_wait(15)
return driver | true | true |
f74e58cbc943beb151b30ea404f5f8fa4de70d3b | 1,500 | py | Python | setup.py | artemudovyk/django-updown | 0353cf8ec5c50b4ffd869a56f51ede65b6368ef8 | [
"BSD-2-Clause"
] | 41 | 2015-01-07T07:43:33.000Z | 2020-09-23T04:35:09.000Z | setup.py | artemudovyk/django-updown | 0353cf8ec5c50b4ffd869a56f51ede65b6368ef8 | [
"BSD-2-Clause"
] | 20 | 2015-01-28T21:02:56.000Z | 2018-08-14T13:39:31.000Z | setup.py | artemudovyk/django-updown | 0353cf8ec5c50b4ffd869a56f51ede65b6368ef8 | [
"BSD-2-Clause"
] | 19 | 2015-01-06T12:50:05.000Z | 2022-01-21T17:01:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from setuptools import setup, find_packages
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.search("__version__ ... | 30.612245 | 75 | 0.599333 | import os
import re
from setuptools import setup, find_packages
def get_version(package):
init_py = open(os.path.join(package, '__init__.py')).read()
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
version = get_version('updown')
setup(
name='django-updown',
version=version... | true | true |
f74e5931d12c8d8f66d8398d3a328487d91e5f55 | 1,424 | py | Python | predictppv/predict_ppv.py | MMichel/PredictPPV | c84ec19545f19982d69f610a0835586ffa22e3de | [
"MIT"
] | null | null | null | predictppv/predict_ppv.py | MMichel/PredictPPV | c84ec19545f19982d69f610a0835586ffa22e3de | [
"MIT"
] | null | null | null | predictppv/predict_ppv.py | MMichel/PredictPPV | c84ec19545f19982d69f610a0835586ffa22e3de | [
"MIT"
] | null | null | null | import sys
from collections import defaultdict
from collections import OrderedDict
import scipy as sp
import numpy as np
import pylab as pl
from sklearn.svm import SVR
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import r2_score
from sklearn.metrics import mean_squared_error
from sklearn... | 27.921569 | 85 | 0.691713 | import sys
from collections import defaultdict
from collections import OrderedDict
import scipy as sp
import numpy as np
import pylab as pl
from sklearn.svm import SVR
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import r2_score
from sklearn.metrics import mean_squared_error
from sklearn... | false | true |
f74e5b74c46faf978204656b1fdfb200cf474752 | 5,363 | py | Python | gobigger/agents/bot_agent.py | Sense-X/GoBigger | fc670973c328c2f898589974e072a9f22517de70 | [
"Apache-2.0"
] | null | null | null | gobigger/agents/bot_agent.py | Sense-X/GoBigger | fc670973c328c2f898589974e072a9f22517de70 | [
"Apache-2.0"
] | null | null | null | gobigger/agents/bot_agent.py | Sense-X/GoBigger | fc670973c328c2f898589974e072a9f22517de70 | [
"Apache-2.0"
] | null | null | null | import os
import random
import logging
import copy
import queue
from pygame.math import Vector2
from .base_agent import BaseAgent
class BotAgent(BaseAgent):
'''
Overview:
A simple script bot
'''
def __init__(self, name=None):
self.name = name
self.actions_queue = queue.Queue()... | 41.898438 | 145 | 0.604512 | import os
import random
import logging
import copy
import queue
from pygame.math import Vector2
from .base_agent import BaseAgent
class BotAgent(BaseAgent):
def __init__(self, name=None):
self.name = name
self.actions_queue = queue.Queue()
self.last_clone_num = 1
self.last_total_s... | true | true |
f74e5c0633cc58b622190661c0457d82ae128d29 | 4,358 | py | Python | opfunu/cec/cec2005/F19.py | mcrimi/opfunu | 9c8a074c5dca604acc3ddc7fbf15ef30f57d1756 | [
"Apache-2.0"
] | 1 | 2021-05-25T14:46:21.000Z | 2021-05-25T14:46:21.000Z | opfunu/cec/cec2005/F19.py | HaaLeo/opfunu | 1ff3ecf4b7818a0edd5d92ce5475839fa9477da1 | [
"Apache-2.0"
] | null | null | null | opfunu/cec/cec2005/F19.py | HaaLeo/opfunu | 1ff3ecf4b7818a0edd5d92ce5475839fa9477da1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "Thieu Nguyen" at 19:26, 20/04/2020 %
# ... | 44.927835 | 133 | 0.490363 |
from opfunu.cec.cec2005.root import Root
from numpy import sum, dot, sqrt, array, cos, pi, exp, e, ones, max
class Model(Root):
def __init__(self, f_name="Rotated Hybrid Composition Function 2 with narrow basin global optimum",
f_shift_data_file="data_hybrid_func2",
f_ext='.txt'... | true | true |
f74e5d1ddd9e64b0c64187d7fd86a1f5d4996bd2 | 195 | py | Python | starter/flyTello.py | liemho1/CpE-EE-Senior-Project | 07fc02d43cb23498281cebf33f610ef55a6d1af5 | [
"MIT"
] | null | null | null | starter/flyTello.py | liemho1/CpE-EE-Senior-Project | 07fc02d43cb23498281cebf33f610ef55a6d1af5 | [
"MIT"
] | null | null | null | starter/flyTello.py | liemho1/CpE-EE-Senior-Project | 07fc02d43cb23498281cebf33f610ef55a6d1af5 | [
"MIT"
] | null | null | null | from easytello import tello
my_drone = tello.Tello()
#my_drone.streamon()
my_drone.takeoff()
for i in range(4):
#my_drone.forward(1)
my_drone.cw(90)
my_drone.land()
# my_drone.streamoff()
| 13.928571 | 27 | 0.728205 | from easytello import tello
my_drone = tello.Tello()
my_drone.takeoff()
for i in range(4):
my_drone.cw(90)
my_drone.land()
| true | true |
f74e5da64ee1d1e4688813dfe571d84ad1150d90 | 547 | py | Python | setup.py | sammish/Reports | 86b2a477a806e48eb5225159bc9c1028487ff135 | [
"MIT"
] | null | null | null | setup.py | sammish/Reports | 86b2a477a806e48eb5225159bc9c1028487ff135 | [
"MIT"
] | null | null | null | setup.py | sammish/Reports | 86b2a477a806e48eb5225159bc9c1028487ff135 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in reports/__init__.py
from reports import __version__ as version
setup(
name='reports',
version=version,
description='Cu... | 26.047619 | 62 | 0.769653 | from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
from reports import __version__ as version
setup(
name='reports',
version=version,
description='Customized Report for All purpose',
author='sammish.thundiyil@gmail.com',
author_email=... | true | true |
f74e5dab495102f4f366cc894df8b9200e06f626 | 185 | py | Python | services/converter.py | ArtiomOn/pull_bot | 1f9db9e38beb1be4ac3a16e36775c73b412ceab4 | [
"MIT"
] | null | null | null | services/converter.py | ArtiomOn/pull_bot | 1f9db9e38beb1be4ac3a16e36775c73b412ceab4 | [
"MIT"
] | null | null | null | services/converter.py | ArtiomOn/pull_bot | 1f9db9e38beb1be4ac3a16e36775c73b412ceab4 | [
"MIT"
] | null | null | null | from pydub import AudioSegment
def convert_ogg_to_wav(ogg_path: str, wav_path: str) -> None:
audio = AudioSegment.from_ogg(file=ogg_path)
audio.export(wav_path, format='wav')
| 26.428571 | 61 | 0.751351 | from pydub import AudioSegment
def convert_ogg_to_wav(ogg_path: str, wav_path: str) -> None:
audio = AudioSegment.from_ogg(file=ogg_path)
audio.export(wav_path, format='wav')
| true | true |
f74e5ecbc8e475fcb002db543c5182ecb782d138 | 83 | py | Python | Boolean/Boolean18.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | Boolean/Boolean18.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | Boolean/Boolean18.py | liyuanyuan11/Python | d94cc7ab39e56c6e24bfc741a30da77590d1d220 | [
"MIT"
] | null | null | null | isAfterSchool=True
isFinishHomework=False
print(isAfterSchool and isFinishHomework) | 27.666667 | 41 | 0.903614 | isAfterSchool=True
isFinishHomework=False
print(isAfterSchool and isFinishHomework) | true | true |
f74e5f6e36adb6ca165a77343a07c7a6ac27c61a | 558 | py | Python | mwlib/snippets.py | pediapress/mwlib | 1074fbc429e65180de09671dbc369ed1eeb2345d | [
"Unlicense"
] | 53 | 2015-02-17T16:20:06.000Z | 2022-03-18T09:22:00.000Z | mwlib/snippets.py | pediapress/mwlib | 1074fbc429e65180de09671dbc369ed1eeb2345d | [
"Unlicense"
] | 23 | 2015-01-30T16:26:20.000Z | 2022-03-11T23:26:03.000Z | mwlib/snippets.py | pediapress/mwlib | 1074fbc429e65180de09671dbc369ed1eeb2345d | [
"Unlicense"
] | 19 | 2015-01-21T13:55:46.000Z | 2019-02-23T23:14:31.000Z | #! /usr/bin/env python
"""provide some mediawiki markup example snippets"""
import os
class snippet(object):
def __init__(self, txt, id):
self.txt = txt
self.id = id
def __repr__(self):
return "<%s %r %r...>" % (self.__class__.__name__, self.id, self.txt[:10])
def get_all():
f... | 22.32 | 82 | 0.594982 |
import os
class snippet(object):
def __init__(self, txt, id):
self.txt = txt
self.id = id
def __repr__(self):
return "<%s %r %r...>" % (self.__class__.__name__, self.id, self.txt[:10])
def get_all():
fp = os.path.join(os.path.dirname(__file__), 'snippets.txt')
examples = ... | true | true |
f74e5f8f74616921ddfa3c986e30955bccb0887a | 5,457 | py | Python | code/lstm_mixed_loso.py | bagustris/deep_mlp_ser | 079bc6414287dbfb23a52e1e1869b91584eb037e | [
"BSD-3-Clause"
] | 7 | 2020-04-21T07:27:31.000Z | 2022-01-18T10:24:37.000Z | code/lstm_mixed_loso.py | bagustris/deep_mlp_ser | 079bc6414287dbfb23a52e1e1869b91584eb037e | [
"BSD-3-Clause"
] | 2 | 2020-10-09T03:04:35.000Z | 2022-01-18T11:37:52.000Z | code/lstm_mixed_loso.py | bagustris/deep_mlp_ser | 079bc6414287dbfb23a52e1e1869b91584eb037e | [
"BSD-3-Clause"
] | 2 | 2020-06-19T23:37:00.000Z | 2021-12-19T22:07:44.000Z | # CSL Paper: Dimensional speech emotion recognition from acoustic and text
# Changelog:
# 2019-09-01: initial version
# 2019-10-06: optimizer MTL parameters with linear search (in progress)
# 2012-12-25: modified fot ser_iemocap_loso_hfs.py
# feature is either std+mean or std+mean+silence (uncomment line 44... | 36.871622 | 123 | 0.702767 |
import numpy as np
import pickle
import pandas as pd
import keras.backend as K
from keras.models import Model
from keras.layers import Input, Dense, CuDNNLSTM, Flatten, \
Embedding, Dropout, BatchNormalization, \
RNN, concatenate, Activation
from keras.callbacks impo... | true | true |
f74e601a8cafe6088876d3419b2ccb2596a50286 | 193 | py | Python | draco/analysis/__init__.py | Arnab-half-blood-prince/draco | f86387a63ecd739ad194dbd5195a44f4a35a521d | [
"MIT"
] | 5 | 2016-12-12T06:37:50.000Z | 2020-04-22T15:21:40.000Z | draco/analysis/__init__.py | Arnab-half-blood-prince/draco | f86387a63ecd739ad194dbd5195a44f4a35a521d | [
"MIT"
] | 102 | 2017-04-28T13:43:01.000Z | 2022-03-11T22:31:14.000Z | draco/analysis/__init__.py | Arnab-half-blood-prince/draco | f86387a63ecd739ad194dbd5195a44f4a35a521d | [
"MIT"
] | 7 | 2017-01-27T16:55:28.000Z | 2022-02-21T16:16:17.000Z | """
.. autosummary::
:toctree:
beamform
delay
fgfilter
flagging
mapmaker
powerspectrum
sensitivity
sidereal
sourcestack
svdfilter
transform
"""
| 11.352941 | 17 | 0.601036 | true | true | |
f74e60c92f213ea2b621b3a4bebfb4b49577419a | 958 | py | Python | app/forms.py | juliuskrah/flask-blog | 4c1dd04b4b93fff127d23cffb7a5fd9d9e711f00 | [
"Apache-2.0"
] | 3 | 2019-06-12T19:42:46.000Z | 2021-06-23T23:18:22.000Z | app/forms.py | juliuskrah/flask-blog | 4c1dd04b4b93fff127d23cffb7a5fd9d9e711f00 | [
"Apache-2.0"
] | null | null | null | app/forms.py | juliuskrah/flask-blog | 4c1dd04b4b93fff127d23cffb7a5fd9d9e711f00 | [
"Apache-2.0"
] | 1 | 2020-07-31T15:58:16.000Z | 2020-07-31T15:58:16.000Z | from flask_wtf import Form
from wtforms import StringField, BooleanField, TextAreaField, validators
from app.models import User
class LoginForm(Form):
remember_me = BooleanField('remember_me', default=False)
class EditForm(Form):
nickname = StringField('nickname', [validators.DataRequired()])
about_me =... | 34.214286 | 102 | 0.683716 | from flask_wtf import Form
from wtforms import StringField, BooleanField, TextAreaField, validators
from app.models import User
class LoginForm(Form):
remember_me = BooleanField('remember_me', default=False)
class EditForm(Form):
nickname = StringField('nickname', [validators.DataRequired()])
about_me =... | true | true |
f74e61fa5159828ae43d260a013f432caf6757aa | 250 | py | Python | cpffield/cpffield.py | silviolleite/cfp-field | 77d1ba554638b1ae31fb165cc0ba3d597ed2f048 | [
"MIT"
] | null | null | null | cpffield/cpffield.py | silviolleite/cfp-field | 77d1ba554638b1ae31fb165cc0ba3d597ed2f048 | [
"MIT"
] | 2 | 2020-02-11T23:05:06.000Z | 2020-06-05T18:46:38.000Z | cpffield/cpffield.py | silviolleite/cfp-field | 77d1ba554638b1ae31fb165cc0ba3d597ed2f048 | [
"MIT"
] | null | null | null | from django.db import models
from cpffield.validators import validate_cpf
class CPFField(models.CharField):
default_validators = [validate_cpf]
def __init__(self, *args, **kwargs):
super(CPFField, self).__init__(*args, **kwargs)
| 20.833333 | 55 | 0.728 | from django.db import models
from cpffield.validators import validate_cpf
class CPFField(models.CharField):
default_validators = [validate_cpf]
def __init__(self, *args, **kwargs):
super(CPFField, self).__init__(*args, **kwargs)
| true | true |
f74e62bba478a312bc944ab85bf578c1d4490c32 | 3,606 | py | Python | bindings/python/ensmallen/datasets/string/neisseriaelongatasubspglycolyticaatcc29315.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/neisseriaelongatasubspglycolyticaatcc29315.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/neisseriaelongatasubspglycolyticaatcc29315.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Neisseria elongata subsp. glycolytica ATCC 29315.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={ST... | 34.342857 | 223 | 0.685524 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def NeisseriaElongataSubspGlycolyticaAtcc29315(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_pat... | true | true |
f74e62fc8a17d8a43dbb0288f8f895e59978ae95 | 1,341 | py | Python | playground/config.py | imankulov/ethereum-playground | 79fa9157c5b747b7929a0021891ea493b87c19ec | [
"MIT"
] | null | null | null | playground/config.py | imankulov/ethereum-playground | 79fa9157c5b747b7929a0021891ea493b87c19ec | [
"MIT"
] | null | null | null | playground/config.py | imankulov/ethereum-playground | 79fa9157c5b747b7929a0021891ea493b87c19ec | [
"MIT"
] | null | null | null | """
Flask configuration.
The module doesn't depend on the project. The configuration file is initialized
with python-dotenv, and we don't read environment variables in the rest of the
project.
What config.py can import?
--------------------------
The module doesn't import anything from the project.
Who can import... | 27.367347 | 82 | 0.722595 | import os
import pathlib
import dotenv
dotenv.load_dotenv()
def adjust_database_uri(variable: str) -> str:
if variable.startswith("postgres://"):
variable = variable.replace("postgres://", "postgresql://")
return variable.replace("{PROJECT_ROOT}", PROJECT_ROOT.as_posix())
PROJECT_R... | true | true |
f74e637b161f82a99d57c721048bd9dbfa619547 | 20,348 | py | Python | tests/test_utils.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 14 | 2019-06-30T06:15:06.000Z | 2021-11-02T15:55:17.000Z | tests/test_utils.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 8 | 2019-11-08T08:17:39.000Z | 2022-02-09T23:30:55.000Z | tests/test_utils.py | bond005/impartial_text_cls | d7503c55388625b988098b307350b1f899e48e3c | [
"Apache-2.0"
] | 3 | 2019-06-30T06:15:42.000Z | 2021-02-16T11:12:47.000Z | # Copyright 2019 Ivan Bondarenko
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 43.385928 | 120 | 0.611903 |
import os
import re
import sys
import unittest
import numpy as np
try:
from impartial_text_cls.utils import read_dstc2_data, read_snips2017_data, str_to_layers, read_csv
from impartial_text_cls.utils import parse_hidden_layers_description
except:
sys.path.append(os.path.join(os.path.dirname(__file__), '.... | true | true |
f74e6453c7546b3a84ac70855dcc663c1b075743 | 26 | py | Python | pog.py | toranjamecanica/pessoal | fa5af0e871d4b28d502d48d1b64981dc025f22a5 | [
"MIT"
] | null | null | null | pog.py | toranjamecanica/pessoal | fa5af0e871d4b28d502d48d1b64981dc025f22a5 | [
"MIT"
] | null | null | null | pog.py | toranjamecanica/pessoal | fa5af0e871d4b28d502d48d1b64981dc025f22a5 | [
"MIT"
] | null | null | null | m = 'ola mundo'
print(m)
| 8.666667 | 16 | 0.576923 | m = 'ola mundo'
print(m)
| true | true |
f74e652b7dde8153ebf301cd813759826c18db84 | 12,495 | py | Python | elliottlib/cli/find_bugs_cli.py | thegreyd/elliott | 4772e2eda36af1b2e3bdaeced4347fcf9ecfdbc2 | [
"Apache-2.0"
] | null | null | null | elliottlib/cli/find_bugs_cli.py | thegreyd/elliott | 4772e2eda36af1b2e3bdaeced4347fcf9ecfdbc2 | [
"Apache-2.0"
] | null | null | null | elliottlib/cli/find_bugs_cli.py | thegreyd/elliott | 4772e2eda36af1b2e3bdaeced4347fcf9ecfdbc2 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
import elliottlib
from elliottlib import constants, logutil, Runtime, bzutil, openshiftclient, errata
LOGGER = logutil.getLogger(__name__)
from elliottlib.cli import cli_opts
from elliottlib.cli.common import cli, use_default_advisory_option, fin... | 52.0625 | 243 | 0.6497 | from __future__ import absolute_import, print_function, unicode_literals
import elliottlib
from elliottlib import constants, logutil, Runtime, bzutil, openshiftclient, errata
LOGGER = logutil.getLogger(__name__)
from elliottlib.cli import cli_opts
from elliottlib.cli.common import cli, use_default_advisory_option, fin... | true | true |
f74e65a9a7255a9aca60a51f3bc6f3cebeeb8c9a | 34 | py | Python | sock_cond/__init__.py | matham/sock_cond | 24a1eaf5d1cb8cbae8e7581df54d03cedc82ec8c | [
"MIT"
] | null | null | null | sock_cond/__init__.py | matham/sock_cond | 24a1eaf5d1cb8cbae8e7581df54d03cedc82ec8c | [
"MIT"
] | null | null | null | sock_cond/__init__.py | matham/sock_cond | 24a1eaf5d1cb8cbae8e7581df54d03cedc82ec8c | [
"MIT"
] | null | null | null | '''
'''
__version__ = '0.1-dev'
| 5.666667 | 23 | 0.470588 |
__version__ = '0.1-dev'
| true | true |
f74e66a4345b855aed3b7edd396915cf9209d501 | 2,282 | py | Python | ucsmsdk/mometa/proc/ProcDoer.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/proc/ProcDoer.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/proc/ProcDoer.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for ProcDoer ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class ProcDoerConsts:
pass
class ProcDoer(ManagedObject):
"""This is ProcDoer class."""
consts = ProcDo... | 46.571429 | 248 | 0.630149 |
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class ProcDoerConsts:
pass
class ProcDoer(ManagedObject):
consts = ProcDoerConsts()
naming_props = set([u'name'])
mo_meta = MoMeta("ProcDoer", "procDoer", "doer[name]", VersionM... | true | true |
f74e6956ca7769438c64aeed0922069d78d973d8 | 5,736 | py | Python | insights/client/support.py | sagaraivale/insights-core | 852a9669c998acf995e316bd407aeb4dbc6c485e | [
"Apache-2.0"
] | 1 | 2018-03-26T12:59:24.000Z | 2018-03-26T12:59:24.000Z | insights/client/support.py | sagaraivale/insights-core | 852a9669c998acf995e316bd407aeb4dbc6c485e | [
"Apache-2.0"
] | null | null | null | insights/client/support.py | sagaraivale/insights-core | 852a9669c998acf995e316bd407aeb4dbc6c485e | [
"Apache-2.0"
] | null | null | null | '''
Module responsible for running the --support option for collecting debug information
'''
import logging
import shlex
import re
import os
import requests
import tempfile
import time
import subprocess
from insights import get_nvr
from subprocess import Popen, PIPE, STDOUT
from constants import InsightsConstants as c... | 37.246753 | 92 | 0.58682 | import logging
import shlex
import re
import os
import requests
import tempfile
import time
import subprocess
from insights import get_nvr
from subprocess import Popen, PIPE, STDOUT
from constants import InsightsConstants as constants
from connection import InsightsConnection
from config import CONFIG as config
APP_N... | true | true |
f74e6a93a2b4a56b4affc7cdbe11026e86cd4a65 | 30,775 | py | Python | src/qa4sm_reader/plotter.py | TUW-GEO/qa4sm-reader | 148b034e883a64b88bdae84ad1f859a1ff483e73 | [
"MIT"
] | null | null | null | src/qa4sm_reader/plotter.py | TUW-GEO/qa4sm-reader | 148b034e883a64b88bdae84ad1f859a1ff483e73 | [
"MIT"
] | 7 | 2020-12-28T13:27:52.000Z | 2021-02-09T15:58:37.000Z | src/qa4sm_reader/plotter.py | TUW-GEO/qa4sm-reader | 148b034e883a64b88bdae84ad1f859a1ff483e73 | [
"MIT"
] | 5 | 2019-08-07T13:18:52.000Z | 2021-01-20T15:25:27.000Z | # -*- coding: utf-8 -*-
import warnings
from pathlib import Path
import seaborn as sns
import pandas as pd
from typing import Union
import numpy as np
import matplotlib.pyplot as plt
from qa4sm_reader.img import QA4SMImg
import qa4sm_reader.globals as globals
from qa4sm_reader import plotting_methods as plm
from warn... | 33.055854 | 117 | 0.53186 | import warnings
from pathlib import Path
import seaborn as sns
import pandas as pd
from typing import Union
import numpy as np
import matplotlib.pyplot as plt
from qa4sm_reader.img import QA4SMImg
import qa4sm_reader.globals as globals
from qa4sm_reader import plotting_methods as plm
from warnings import warn
class... | true | true |
f74e6b2a6c311aea3fd5e26ce67c26f2f013359f | 16,032 | py | Python | scripts_hico/train_test.py | ASMIftekhar/VSGNet | 9ca9a1c42b93a386f56be1bf1c5dd47c3134a090 | [
"MIT"
] | 111 | 2020-02-27T16:00:27.000Z | 2022-03-22T08:09:56.000Z | scripts_hico/train_test.py | ASMIftekhar/VSGNet | 9ca9a1c42b93a386f56be1bf1c5dd47c3134a090 | [
"MIT"
] | 21 | 2020-04-24T11:37:59.000Z | 2022-02-28T03:10:08.000Z | scripts_hico/train_test.py | ASMIftekhar/VSGNet | 9ca9a1c42b93a386f56be1bf1c5dd47c3134a090 | [
"MIT"
] | 23 | 2020-03-18T10:50:07.000Z | 2022-02-09T12:35:57.000Z | import torch
import torch.nn as nn
import time
import errno
import os
import gc
import pickle
import shutil
import json
import os
import pandas as pd
from skimage import io, transform
import numpy as np
import calculate_ap_classwise as ap
import matplotlib.pyplot as plt
import random
import helpers_preprocess as helpe... | 35.865772 | 220 | 0.627058 | import torch
import torch.nn as nn
import time
import errno
import os
import gc
import pickle
import shutil
import json
import os
import pandas as pd
from skimage import io, transform
import numpy as np
import calculate_ap_classwise as ap
import matplotlib.pyplot as plt
import random
import helpers_preprocess as helpe... | false | true |
f74e6d2697754f19bf7da97d5060f35859284d2c | 4,307 | py | Python | tests/management/commands/test_sqlcreate.py | Mesteriis/django-extensions | b09cf0be83e0a095939d423554d6b0c7699c99cb | [
"MIT"
] | null | null | null | tests/management/commands/test_sqlcreate.py | Mesteriis/django-extensions | b09cf0be83e0a095939d423554d6b0c7699c99cb | [
"MIT"
] | 1 | 2020-08-06T06:50:40.000Z | 2020-08-06T06:50:40.000Z | tests/management/commands/test_sqlcreate.py | Mesteriis/django-extensions | b09cf0be83e0a095939d423554d6b0c7699c99cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from io import StringIO
from django.core.management import CommandError, call_command
from django.test import TestCase
from django.test.utils import override_settings
from unittest.mock import patch
MYSQL_DATABASE_SETTINGS = {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dbatabase'... | 36.5 | 121 | 0.716276 | from io import StringIO
from django.core.management import CommandError, call_command
from django.test import TestCase
from django.test.utils import override_settings
from unittest.mock import patch
MYSQL_DATABASE_SETTINGS = {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dbatabase',
'USER': 'foo',
... | true | true |
f74e6d90ad90a94850b2dbd4aea40c7222793820 | 8,662 | py | Python | python/dlbs/result_processor.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | 123 | 2017-11-28T20:21:24.000Z | 2022-03-22T11:21:04.000Z | python/dlbs/result_processor.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | 17 | 2018-01-05T00:05:13.000Z | 2020-09-18T05:12:45.000Z | python/dlbs/result_processor.py | joehandzik/dlcookbook-dlbs | 7c5ca5a6dfa4e2f7b8b4d81c60bd8be343dabd30 | [
"Apache-2.0"
] | 48 | 2018-01-04T20:52:51.000Z | 2022-03-06T00:47:17.000Z | # (c) Copyright [2017] Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 38.669643 | 99 | 0.676749 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
from collections import defaultdict
from dlbs.utils import Six
from dlbs.utils import DictUtils
from dlbs.processor import Processor
def load_json_file(file_name):
with open(fil... | true | true |
f74e6da07c41db1cf0086e4d84562ae558d240c3 | 1,047 | py | Python | demo/components/scalar_test.py | rainyfly/VisualDL | aa1bd8e6a993d4a355f07c7c5461a1853ca790c9 | [
"Apache-2.0"
] | 4,861 | 2017-12-21T01:54:59.000Z | 2022-03-31T07:56:56.000Z | demo/components/scalar_test.py | boy-nan/VisualDL | acd7bc43f0db3ed0e8d7b077ac1cfbb41eb97e20 | [
"Apache-2.0"
] | 485 | 2017-12-21T02:04:55.000Z | 2022-03-31T05:56:50.000Z | demo/components/scalar_test.py | boy-nan/VisualDL | acd7bc43f0db3ed0e8d7b077ac1cfbb41eb97e20 | [
"Apache-2.0"
] | 655 | 2017-12-21T08:34:54.000Z | 2022-03-28T03:50:12.000Z | # Copyright (c) 2020 VisualDL Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 40.269231 | 79 | 0.665712 |
from visualdl import LogWriter
if __name__ == '__main__':
value = [i/1000.0 for i in range(1000)]
with LogWriter(logdir="./log/scalar_test/train") as writer:
for step in range(1000):
writer.add_scalar(tag="acc", step=step, value=value[step])
writer.add_scalar(tag="loss", step=... | true | true |
f74e6e111dc5cf036a9b72aaa6634cb362c37e6b | 212,722 | py | Python | tests/unit/test_blob.py | ddelgrosso1/python-storage | 4abb40310eca7ec45afc4bc5e4dfafbe083e74d2 | [
"Apache-2.0"
] | 2 | 2021-10-02T01:54:01.000Z | 2021-11-17T10:35:03.000Z | tests/unit/test_blob.py | Ark-kun/python-storage | bd72f5d7017c6e196e0cc5f7c537c848c83f889d | [
"Apache-2.0"
] | null | null | null | tests/unit/test_blob.py | Ark-kun/python-storage | bd72f5d7017c6e196e0cc5f7c537c848c83f889d | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 37.189161 | 115 | 0.641795 |
import base64
import datetime
import hashlib
import io
import json
import os
import tempfile
import unittest
import mock
import pytest
import six
from six.moves import http_client
from six.moves.urllib.parse import urlencode
from google.cloud.storage.retry import DEFAULT_RETRY
from google.cloud.storage.retry import ... | true | true |
f74e6f4bf238185e9c67a18c4d0fc5e67ed55f09 | 7,952 | py | Python | sentry_sdk/integrations/aiohttp.py | annu-ps31/sentry-python | 3966b4a9744bfcb8c53dcca1b615bbadf4935aec | [
"BSD-2-Clause"
] | 1,213 | 2018-06-19T00:51:01.000Z | 2022-03-31T06:37:16.000Z | sentry_sdk/integrations/aiohttp.py | annu-ps31/sentry-python | 3966b4a9744bfcb8c53dcca1b615bbadf4935aec | [
"BSD-2-Clause"
] | 1,020 | 2018-07-16T12:50:36.000Z | 2022-03-31T20:42:49.000Z | sentry_sdk/integrations/aiohttp.py | annu-ps31/sentry-python | 3966b4a9744bfcb8c53dcca1b615bbadf4935aec | [
"BSD-2-Clause"
] | 340 | 2018-07-16T12:47:27.000Z | 2022-03-22T10:13:21.000Z | import sys
import weakref
from sentry_sdk._compat import reraise
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration, DidNotEnable
from sentry_sdk.integrations.logging import ignore_logger
from sentry_sdk.integrations._wsgi_common import (
_filter_headers,
request_body_within_bounds,... | 34.128755 | 88 | 0.607772 | import sys
import weakref
from sentry_sdk._compat import reraise
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration, DidNotEnable
from sentry_sdk.integrations.logging import ignore_logger
from sentry_sdk.integrations._wsgi_common import (
_filter_headers,
request_body_within_bounds,... | true | true |
f74e7068125f18a42bbdbdac6a8cb0238b15fc4c | 145 | py | Python | Python Programs/LcmGcd.py | tanvi003/Basic_programs | 6639334cc40866b04e3e25c7e38136e4abc995d3 | [
"MIT"
] | null | null | null | Python Programs/LcmGcd.py | tanvi003/Basic_programs | 6639334cc40866b04e3e25c7e38136e4abc995d3 | [
"MIT"
] | null | null | null | Python Programs/LcmGcd.py | tanvi003/Basic_programs | 6639334cc40866b04e3e25c7e38136e4abc995d3 | [
"MIT"
] | 1 | 2019-10-26T18:52:30.000Z | 2019-10-26T18:52:30.000Z | from math import gcd
for x in range(int(input())):
(a,b)=[int(m) for m in input().split()]
k=gcd(a,b)
lcm =(a*b//k)
print(k,lcm)
| 20.714286 | 43 | 0.544828 | from math import gcd
for x in range(int(input())):
(a,b)=[int(m) for m in input().split()]
k=gcd(a,b)
lcm =(a*b//k)
print(k,lcm)
| true | true |
f74e709768c35adeecd7a0188985a78d6d434a2a | 7,893 | py | Python | RobotLibrary/Library/RobotLibrary.py | aaron-goff/automated-channel-testing | 1590b3dba0e2a30b3eaa3d63fb103eec6f841dad | [
"Apache-2.0"
] | null | null | null | RobotLibrary/Library/RobotLibrary.py | aaron-goff/automated-channel-testing | 1590b3dba0e2a30b3eaa3d63fb103eec6f841dad | [
"Apache-2.0"
] | null | null | null | RobotLibrary/Library/RobotLibrary.py | aaron-goff/automated-channel-testing | 1590b3dba0e2a30b3eaa3d63fb103eec6f841dad | [
"Apache-2.0"
] | null | null | null | ########################################################################
# Copyright 2019 Roku, 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... | 33.587234 | 94 | 0.614722 |
from robot.api.deco import keyword
from Library.webDriver import WebDriver
from robot.libraries.BuiltIn import BuiltIn
from time import sleep
from robot.api import logger
import subprocess
import json
from datetime import datetime, timedelta
class RobotLibrary:
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
ROBOT_LISTENER_A... | true | true |
f74e70c85a6559f91b2604427bb0512e28b8f091 | 5,638 | py | Python | nodejs/yolov5/hubconf.py | gaeunpark924/Comprehensive-Design-2 | 3a4ca01c5f3daa58a90516654bcd3cc4e8725506 | [
"Apache-2.0"
] | 10 | 2021-05-23T11:39:24.000Z | 2022-03-14T18:20:10.000Z | nodejs/yolov5/hubconf.py | gaeunpark924/Comprehensive-Design-2 | 3a4ca01c5f3daa58a90516654bcd3cc4e8725506 | [
"Apache-2.0"
] | null | null | null | nodejs/yolov5/hubconf.py | gaeunpark924/Comprehensive-Design-2 | 3a4ca01c5f3daa58a90516654bcd3cc4e8725506 | [
"Apache-2.0"
] | 1 | 2022-03-03T15:10:49.000Z | 2022-03-03T15:10:49.000Z | """YOLOv5 PyTorch Hub models https://pytorch.org/hub/ultralytics_yolov5/
Usage:
import torch
model = torch.hub.load('ultralytics/yolov5', 'yolov5s')
"""
import torch
def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbose=True, device=None):
"""Creates a specified YOLOv5 model... | 44.746032 | 120 | 0.684285 |
import torch
def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbose=True, device=None):
from pathlib import Path
from models.yolo import Model, attempt_load
from utils.general import check_requirements, set_logging
from utils.google_utils import attempt_download
from ... | true | true |
f74e71e4855f086f7b879c8f77f347776013f197 | 628 | py | Python | tests/test_simple_storage.py | jayantpatil/brownie-simple-storage | f501e94e88576a9a267ea451c046cedcb7100871 | [
"MIT"
] | null | null | null | tests/test_simple_storage.py | jayantpatil/brownie-simple-storage | f501e94e88576a9a267ea451c046cedcb7100871 | [
"MIT"
] | null | null | null | tests/test_simple_storage.py | jayantpatil/brownie-simple-storage | f501e94e88576a9a267ea451c046cedcb7100871 | [
"MIT"
] | null | null | null | from brownie import SimpleStorage, accounts
def test_deploy():
# Arrange
account = accounts[0]
# Act
simple_storage = SimpleStorage.deploy({"from": account})
starting_value = simple_storage.retrieve()
expected = 0
# Assert
assert starting_value == expected
def testupdating_storage(... | 21.655172 | 70 | 0.686306 | from brownie import SimpleStorage, accounts
def test_deploy():
account = accounts[0]
simple_storage = SimpleStorage.deploy({"from": account})
starting_value = simple_storage.retrieve()
expected = 0
assert starting_value == expected
def testupdating_storage():
account = acco... | true | true |
f74e721c9e381737188ca41c059a69b6f8d80b02 | 5,004 | py | Python | BatchEnv.py | aws-samples/aws-batch-cicd-test-pipeline | ea347ba2a4137c7797ffdfeb0915fee83f4ae970 | [
"MIT-0"
] | null | null | null | BatchEnv.py | aws-samples/aws-batch-cicd-test-pipeline | ea347ba2a4137c7797ffdfeb0915fee83f4ae970 | [
"MIT-0"
] | null | null | null | BatchEnv.py | aws-samples/aws-batch-cicd-test-pipeline | ea347ba2a4137c7797ffdfeb0915fee83f4ae970 | [
"MIT-0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
#
# 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 ... | 42.05042 | 105 | 0.588729 |
from aws_cdk import (
core,
aws_batch,
aws_ec2,
aws_events,
aws_events_targets,
aws_ssm,
aws_ecr,
aws_ecs
)
class BatchEnvironment(core.Stack):
def __init__(self, scope: core.Construct, id: str, namespace, ** kwargs) -> None:
super().__init__(scope, id, **kwargs)
... | true | true |
f74e72d400feb790816dacd6a9269d0a34b4fa53 | 2,707 | py | Python | app/core/tests/test_models.py | sorwarduet/recipe-app-api | ab13680369a693e5bf9d864328384f5781722cc2 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | sorwarduet/recipe-app-api | ab13680369a693e5bf9d864328384f5781722cc2 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | sorwarduet/recipe-app-api | ab13680369a693e5bf9d864328384f5781722cc2 | [
"MIT"
] | null | null | null | import uuid
from unittest.mock import patch
from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='test@test.com', password='testpass'):
"""Create the sample user for test"""
return get_user_model().objects.create_user(email,password)
cl... | 28.197917 | 70 | 0.623569 | import uuid
from unittest.mock import patch
from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='test@test.com', password='testpass'):
return get_user_model().objects.create_user(email,password)
class ModelTests(TestCase):
def test_us... | true | true |
f74e743f9b6cb9cc702a94db6a855b47204b5c3f | 1,480 | py | Python | chapter_13/getfile.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_13/getfile.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_13/getfile.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | "Download utility"
#!/usr/local/bin/python
"""
Fetch an arbitrary file by FTP. Anonymous FTP unless you pass a
user=(name, pswd) tuple. Self-test FTPs a test file and site.
"""
from ftplib import FTP # socket-based FTP tools
from os.path import exists # file existence test
def getfile(f... | 32.173913 | 83 | 0.589865 |
from ftplib import FTP from os.path import exists
def getfile(file, site, dir, user=(), *, verbose=True, refetch=False):
if exists(file) and not refetch:
if verbose: print(file, 'already fetched')
else:
if verbose: print('Downloading', file)
local = open(... | true | true |
f74e74afdc50a91e76566d1986577c266b4f4af9 | 12,515 | py | Python | data/user_input/model/setup/acoustic/specificimpedanceInput.py | open-pulse/OpenPulse | ef49cd1ff672821c4b57729c0ef9f4ff5a83eadf | [
"MIT"
] | 23 | 2020-01-14T12:49:11.000Z | 2021-11-10T05:19:29.000Z | data/user_input/model/setup/acoustic/specificimpedanceInput.py | open-pulse/OpenPulse | ef49cd1ff672821c4b57729c0ef9f4ff5a83eadf | [
"MIT"
] | 101 | 2020-01-23T19:29:00.000Z | 2022-03-15T17:56:23.000Z | data/user_input/model/setup/acoustic/specificimpedanceInput.py | open-pulse/OpenPulse | ef49cd1ff672821c4b57729c0ef9f4ff5a83eadf | [
"MIT"
] | 3 | 2020-01-14T12:49:26.000Z | 2022-01-13T02:06:53.000Z | from data.user_input.project.printMessageInput import PrintMessageInput
import os
from os.path import basename
import numpy as np
from PyQt5.QtWidgets import QToolButton, QPushButton, QLineEdit, QFileDialog, QDialog, QTabWidget, QWidget, QTreeWidgetItem, QTreeWidget, QSpinBox
from PyQt5.QtGui import QIcon
from PyQt5.Q... | 44.222615 | 156 | 0.669117 | from data.user_input.project.printMessageInput import PrintMessageInput
import os
from os.path import basename
import numpy as np
from PyQt5.QtWidgets import QToolButton, QPushButton, QLineEdit, QFileDialog, QDialog, QTabWidget, QWidget, QTreeWidgetItem, QTreeWidget, QSpinBox
from PyQt5.QtGui import QIcon
from PyQt5.Q... | true | true |
f74e750e6c96f16bba84fd130d5423adea67bf3f | 3,642 | py | Python | backend/server/wopr/forms/turbine.py | JenardKin/django-react-boilerplate | dde2c817a502e1bed4c4c0618b10b3a381eff6cf | [
"MIT"
] | null | null | null | backend/server/wopr/forms/turbine.py | JenardKin/django-react-boilerplate | dde2c817a502e1bed4c4c0618b10b3a381eff6cf | [
"MIT"
] | null | null | null | backend/server/wopr/forms/turbine.py | JenardKin/django-react-boilerplate | dde2c817a502e1bed4c4c0618b10b3a381eff6cf | [
"MIT"
] | null | null | null | from django import forms
from wopr.utils import makeTurbineList, makeSiteList
from wopr.models import TSiteconfig
from wopr.widgets import XDSoftDateTimePickerInput
class TurbineSelectionForm(forms.Form):
# Default values
CHOICES = list(range(1, 100))
start_time = forms.DateTimeField(input_formats=['%d/%m... | 56.030769 | 136 | 0.683965 | from django import forms
from wopr.utils import makeTurbineList, makeSiteList
from wopr.models import TSiteconfig
from wopr.widgets import XDSoftDateTimePickerInput
class TurbineSelectionForm(forms.Form):
CHOICES = list(range(1, 100))
start_time = forms.DateTimeField(input_formats=['%d/%m/%Y %H:%M'], widg... | true | true |
f74e7547dcbdb1a6023e6947235912e4c1c29048 | 287 | py | Python | package/tests/data/postprocessing_examples/output/result4_pre.py | MrKriss/stonemason | d78becc9168c2566b31b48c9a951e2823bc98362 | [
"MIT"
] | 2 | 2017-11-13T17:40:52.000Z | 2021-05-08T15:58:28.000Z | package/tests/data/postprocessing_examples/output/result4_pre.py | MrKriss/masonry | d78becc9168c2566b31b48c9a951e2823bc98362 | [
"MIT"
] | 3 | 2017-09-03T22:58:37.000Z | 2017-09-12T21:45:27.000Z | package/tests/data/postprocessing_examples/output/result4_pre.py | MrKriss/stonemason | d78becc9168c2566b31b48c9a951e2823bc98362 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
MY_CONSTANT = 12124
def my_new_first_function(arg1, arg2):
"""This is my doc string of things"""
ans = arg1 * arg2
return ans
a = 10
b = 20
if __name__ == '__main__':
print(function1(5, 6))
print(function2(5, 6))
| 14.35 | 41 | 0.609756 |
MY_CONSTANT = 12124
def my_new_first_function(arg1, arg2):
ans = arg1 * arg2
return ans
a = 10
b = 20
if __name__ == '__main__':
print(function1(5, 6))
print(function2(5, 6))
| true | true |
f74e75633a8b9389dad6f1442f6f320370b6a185 | 19,268 | py | Python | scripts/west_commands/build.py | jakub-uC/zephyr | d66d748b710ef7520d25d01752ea8a8c89c9e788 | [
"Apache-2.0"
] | 7 | 2021-07-27T00:12:02.000Z | 2022-03-09T14:40:13.000Z | scripts/west_commands/build.py | jakub-uC/zephyr | d66d748b710ef7520d25d01752ea8a8c89c9e788 | [
"Apache-2.0"
] | 17 | 2021-02-16T12:10:08.000Z | 2022-02-17T15:13:21.000Z | scripts/west_commands/build.py | jakub-uC/zephyr | d66d748b710ef7520d25d01752ea8a8c89c9e788 | [
"Apache-2.0"
] | 3 | 2018-09-05T11:29:34.000Z | 2021-03-19T06:55:54.000Z | # Copyright (c) 2018 Foundries.io
#
# SPDX-License-Identifier: Apache-2.0
import argparse
import os
import pathlib
import shlex
import sys
from west import log
from west.configuration import config
from zcmake import DEFAULT_CMAKE_GENERATOR, run_cmake, run_build, CMakeCache
from build_helpers import is_zephyr_build, ... | 41.796095 | 79 | 0.588644 |
import argparse
import os
import pathlib
import shlex
import sys
from west import log
from west.configuration import config
from zcmake import DEFAULT_CMAKE_GENERATOR, run_cmake, run_build, CMakeCache
from build_helpers import is_zephyr_build, find_build_dir, \
FIND_BUILD_DIR_DESCRIPTION
from zephyr_ext_common i... | true | true |
f74e7586663eabcd4b568113d93421bfbbcbfc5a | 5,012 | py | Python | SearchFiles.py | sempf/AndroidCodeReview | e0de665832cdb00a597b1bb7b4baed4578e96a3a | [
"MIT"
] | null | null | null | SearchFiles.py | sempf/AndroidCodeReview | e0de665832cdb00a597b1bb7b4baed4578e96a3a | [
"MIT"
] | null | null | null | SearchFiles.py | sempf/AndroidCodeReview | e0de665832cdb00a597b1bb7b4baed4578e96a3a | [
"MIT"
] | null | null | null | """
SYNOPSIS
SearchFiles
DESCRIPTION
Searches reversed Android codebases for vulnerabilities from the OWASP Mobile Testing Plan, and
POINT research
USAGE
python SearchFiles
AUTHOR
Bill Sempf <bill@pointweb.net>
VERSION
0.1.0.0
"""
import os
with open("C:/Temp/result.txt", "w") as resul... | 48.192308 | 120 | 0.443735 |
import os
with open("C:/Temp/result.txt", "w") as results:
for root, dirs, files in os.walk("C:\\temp\\project", topdown=False):
for filename in files:
with open(os.path.join(root,filename)) as currentFile:
text = currentFile.read()
if ('MODE_PRIVATE' in text) or... | true | true |
f74e75df278495669b335d0c715ecb87058b06da | 3,955 | py | Python | invasion.py | johnnyapol/invasion-tracker-twitter-bot | 208c10608160f2730e54777a256377a6731033fe | [
"MIT"
] | null | null | null | invasion.py | johnnyapol/invasion-tracker-twitter-bot | 208c10608160f2730e54777a256377a6731033fe | [
"MIT"
] | null | null | null | invasion.py | johnnyapol/invasion-tracker-twitter-bot | 208c10608160f2730e54777a256377a6731033fe | [
"MIT"
] | null | null | null | '''
Created on May 3, 2016
@author: johnnyapol
'''
from urllib.request import urlopen
# Try to import simplejson, otherwise fallback to json
try:
import simplejson as json
except ImportError:
import json
class Invasion:
# Global Vars
API = "https://www.toontownrewritten.com/api/in... | 37.666667 | 110 | 0.51555 |
from urllib.request import urlopen
try:
import simplejson as json
except ImportError:
import json
class Invasion:
API = "https://www.toontownrewritten.com/api/invasions"
CHECK_FREQUENCY = 2 updated = -1
invList = []
def __init__(self, _tweetmgr):
prin... | true | true |
f74e7740fb202ee8e255186042bdb159c248fb85 | 781 | py | Python | jinjamator/plugins/content/json.py | jinjamator/jinjamator | 6c48a6eedea9b9f461c66b5dddd609fa39610f0d | [
"Apache-2.0"
] | 7 | 2020-05-06T07:48:14.000Z | 2021-12-11T15:57:26.000Z | jinjamator/plugins/content/json.py | jinjamator/jinjamator | 6c48a6eedea9b9f461c66b5dddd609fa39610f0d | [
"Apache-2.0"
] | 1 | 2020-04-11T15:13:07.000Z | 2020-04-27T20:01:34.000Z | jinjamator/plugins/content/json.py | jinjamator/jinjamator | 6c48a6eedea9b9f461c66b5dddd609fa39610f0d | [
"Apache-2.0"
] | 1 | 2020-05-29T08:53:08.000Z | 2020-05-29T08:53:08.000Z | # Copyright 2019 Wilhelm Putz
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 31.24 | 74 | 0.751601 |
from json import dumps as json_dumps, loads as json_loads
def dumps(data):
return json_dumps(data, sort_keys=True, indent=2)
def loads(data):
return json_loads(data)
| true | true |
f74e78cf2d25d779e5ac98dedbad042ed45424dc | 5,434 | py | Python | apps/pig/src/pig/management/commands/pig_setup.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | apps/pig/src/pig/management/commands/pig_setup.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | apps/pig/src/pig/management/commands/pig_setup.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 35.986755 | 107 | 0.704637 |
import json
import logging
import os
import sys
from django.core import management
from django.core.management.base import BaseCommand
from django.db import transaction
from desktop.conf import USE_NEW_EDITOR
from desktop.lib import paths
from desktop.models import Directory, Document, Document2, Document2Permission... | true | true |
f74e794c8be8902796a2b45001c1a20d727a7aed | 6,013 | py | Python | docusign_esign/models/recipient_update_response.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | docusign_esign/models/recipient_update_response.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | docusign_esign/models/recipient_update_response.py | hunk/docusign-python-client | a643c42c1236715e74eef6fc279a1b29da1b5455 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from p... | 27.967442 | 126 | 0.589223 |
from pprint import pformat
from six import iteritems
import re
class RecipientUpdateResponse(object):
def __init__(self, combined=None, error_details=None, recipient_id=None, recipient_id_guid=None, tabs=None):
self.swagger_types = {
'combined': 'str',
'error_details': 'ErrorDet... | true | true |
f74e7a7cdc36ddb594f6181727cad88e20167890 | 12,225 | py | Python | falcon/util/uri.py | mostrovsky/falcon | ca47895d9d04ec85e5032b26cc62495a9c35a036 | [
"Apache-2.0"
] | 1 | 2020-07-11T14:38:32.000Z | 2020-07-11T14:38:32.000Z | falcon/util/uri.py | repustate/falcon | ca47895d9d04ec85e5032b26cc62495a9c35a036 | [
"Apache-2.0"
] | null | null | null | falcon/util/uri.py | repustate/falcon | ca47895d9d04ec85e5032b26cc62495a9c35a036 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 by Rackspace Hosting, 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 t... | 34.730114 | 78 | 0.641554 |
import six
_UNRESERVED = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
'abcdefghijklmnopqrstuvwxyz'
'0123456789'
'-._~')
_DELIMITERS = ":/?#[]@!$&'()*+,;="
_ALL_ALLOWED = _UNRESERVED + _DELIMITERS
_HEX_DIGITS = '0123456789ABCDEFabcdef'
def _create_char_encoder(allowed_chars):
loo... | true | true |
f74e7b0614d01c21e92a3547d2e3b6f20d964807 | 868 | py | Python | apps/news/serializers.py | dengjinshan/xfz | 2387a214a81b1487518c358291944d84736d7fff | [
"MIT"
] | null | null | null | apps/news/serializers.py | dengjinshan/xfz | 2387a214a81b1487518c358291944d84736d7fff | [
"MIT"
] | null | null | null | apps/news/serializers.py | dengjinshan/xfz | 2387a214a81b1487518c358291944d84736d7fff | [
"MIT"
] | null | null | null | from rest_framework import serializers
from apps.news.models import News, NewsCategory, Comment, Banner
from apps.xfzauth.serializers import UserSeralizers
class NewsCategorySerializers(serializers.ModelSerializer):
class Meta:
model = NewsCategory
fields = ['id', 'name']
class NewsSerializers(s... | 31 | 75 | 0.690092 | from rest_framework import serializers
from apps.news.models import News, NewsCategory, Comment, Banner
from apps.xfzauth.serializers import UserSeralizers
class NewsCategorySerializers(serializers.ModelSerializer):
class Meta:
model = NewsCategory
fields = ['id', 'name']
class NewsSerializers(s... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.