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
f7409aa4a047d52ccbf948a6164682ae33e8686a
1,025
py
Python
test_project/test_project/urls.py
mpasternak/django-nginx-http-push-stream
9689071ca53fe958c9652dafe87316ed097a1ec8
[ "MIT" ]
4
2019-01-19T15:56:52.000Z
2020-01-16T08:13:50.000Z
test_project/test_project/urls.py
mpasternak/django-nginx-http-push-stream
9689071ca53fe958c9652dafe87316ed097a1ec8
[ "MIT" ]
3
2019-03-01T18:13:12.000Z
2021-06-10T21:08:35.000Z
test_project/test_project/urls.py
mpasternak/django-nginx-http-push-stream
9689071ca53fe958c9652dafe87316ed097a1ec8
[ "MIT" ]
null
null
null
"""test_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/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-...
36.607143
77
0.725854
from django.contrib import admin from django.urls import path from nginx_push_stream.auth import auth_request from test_app.views import TestAppView, message_received urlpatterns = [ path('admin/', admin.site.urls), path('', TestAppView.as_view()), path('message_received', message_received, name="message_...
true
true
f7409bb1ec7378bd7439951ba0b05ae0df9c1973
16,724
py
Python
tests/test_corosync_config.py
whamcloud/iml-agent
fecb2468fd6edc822f3ab37ced444d98d8725730
[ "MIT" ]
1
2020-04-22T16:43:09.000Z
2020-04-22T16:43:09.000Z
tests/test_corosync_config.py
whamcloud/iml-agent
fecb2468fd6edc822f3ab37ced444d98d8725730
[ "MIT" ]
53
2018-07-07T18:17:50.000Z
2021-03-19T23:15:28.000Z
tests/test_corosync_config.py
whamcloud/iml-agent
fecb2468fd6edc822f3ab37ced444d98d8725730
[ "MIT" ]
6
2018-06-18T08:51:38.000Z
2019-10-24T12:16:42.000Z
import sys import mock from iml_common.test.command_capture_testcase import ( CommandCaptureTestCase, CommandCaptureCommand, ) from iml_common.lib.firewall_control import FirewallControlEL7 from iml_common.lib.service_control import ServiceControlEL7 from iml_common.lib.agent_rpc import agent_result_ok class...
34.914405
119
0.581918
import sys import mock from iml_common.test.command_capture_testcase import ( CommandCaptureTestCase, CommandCaptureCommand, ) from iml_common.lib.firewall_control import FirewallControlEL7 from iml_common.lib.service_control import ServiceControlEL7 from iml_common.lib.agent_rpc import agent_result_ok class...
true
true
f7409bee1a8697b884df149ff76b3342e2824c6a
4,396
py
Python
src/rankfun.py
EnricoMagnago/F3
c863215c318d7d5f258eb9be38c6962cf6863b52
[ "MIT" ]
3
2021-04-23T23:29:26.000Z
2022-03-23T10:00:30.000Z
src/rankfun.py
EnricoMagnago/F3
c863215c318d7d5f258eb9be38c6962cf6863b52
[ "MIT" ]
null
null
null
src/rankfun.py
EnricoMagnago/F3
c863215c318d7d5f258eb9be38c6962cf6863b52
[ "MIT" ]
1
2021-11-17T22:02:56.000Z
2021-11-17T22:02:56.000Z
from __future__ import annotations from typing import FrozenSet, Optional from pysmt.environment import Environment as PysmtEnv from pysmt.fnode import FNode from pysmt.typing import PySMTType from utils import to_next class RankFun(): """Represents a ranking function. `expr` that can decrease of `delta` a ...
39.963636
94
0.617834
from __future__ import annotations from typing import FrozenSet, Optional from pysmt.environment import Environment as PysmtEnv from pysmt.fnode import FNode from pysmt.typing import PySMTType from utils import to_next class RankFun(): def __init__(self, env: PysmtEnv, expr: FNode, delta: FNode...
true
true
f7409c17631a1926bf69b56bf975747c208a4ca5
22,529
py
Python
distributed/tests/test_utils.py
phobson/distributed
b7fc7be45751f6bc0294f785e9dde376f2d88bd6
[ "BSD-3-Clause" ]
null
null
null
distributed/tests/test_utils.py
phobson/distributed
b7fc7be45751f6bc0294f785e9dde376f2d88bd6
[ "BSD-3-Clause" ]
null
null
null
distributed/tests/test_utils.py
phobson/distributed
b7fc7be45751f6bc0294f785e9dde376f2d88bd6
[ "BSD-3-Clause" ]
null
null
null
import array import asyncio import contextvars import functools import io import os import queue import socket import traceback import warnings from collections import deque from time import sleep import pytest from tornado.ioloop import IOLoop import dask from distributed.compatibility import MACOS, WINDOWS from di...
25.143973
88
0.606507
import array import asyncio import contextvars import functools import io import os import queue import socket import traceback import warnings from collections import deque from time import sleep import pytest from tornado.ioloop import IOLoop import dask from distributed.compatibility import MACOS, WINDOWS from di...
true
true
f7409e17d3b433e35871f9a9f3137069f635afc6
1,382
py
Python
app/fetcher/used_fetcher.py
msusicky/ockovani-covid
2835943b5796b04a3542782ecda125b6766cd317
[ "Apache-2.0" ]
62
2021-01-16T18:02:57.000Z
2022-01-12T21:10:34.000Z
app/fetcher/used_fetcher.py
msusicky/ockovani-covid
2835943b5796b04a3542782ecda125b6766cd317
[ "Apache-2.0" ]
224
2021-01-16T19:11:01.000Z
2022-03-15T19:42:37.000Z
app/fetcher/used_fetcher.py
msusicky/ockovani-covid
2835943b5796b04a3542782ecda125b6766cd317
[ "Apache-2.0" ]
13
2021-01-16T18:38:11.000Z
2021-07-02T20:09:47.000Z
import pandas as pd from app import db, app from app.fetcher.fetcher import Fetcher from app.models import OckovaniSpotreba, OckovaciMisto class UsedFetcher(Fetcher): """ Class for updating used vaccines table. """ USED_CSV = 'https://onemocneni-aktualne.mzcr.cz/api/v2/covid-19/ockovani-spotreba.csv...
33.707317
118
0.659913
import pandas as pd from app import db, app from app.fetcher.fetcher import Fetcher from app.models import OckovaniSpotreba, OckovaciMisto class UsedFetcher(Fetcher): USED_CSV = 'https://onemocneni-aktualne.mzcr.cz/api/v2/covid-19/ockovani-spotreba.csv' def __init__(self): super().__init__(Ockovani...
true
true
f7409e9a4f7b4008d8ef35f97087b065704d72e8
5,951
py
Python
assignment1/src/offboard_UMD/script/plot_position.py
rodrigodelazcano/AerialRobotics
44d7929721eaf3c817cf7f70966e805b36f66981
[ "BSD-3-Clause" ]
null
null
null
assignment1/src/offboard_UMD/script/plot_position.py
rodrigodelazcano/AerialRobotics
44d7929721eaf3c817cf7f70966e805b36f66981
[ "BSD-3-Clause" ]
null
null
null
assignment1/src/offboard_UMD/script/plot_position.py
rodrigodelazcano/AerialRobotics
44d7929721eaf3c817cf7f70966e805b36f66981
[ "BSD-3-Clause" ]
null
null
null
import numpy as np import rosbag import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from tf.transformations import euler_from_quaternion # Read bag file bag = rosbag.Bag('2021-09-21-19-57-22.bag') x = [] y = [] z = [] roll = [] pitch = [] yaw = [] time = [] cycles = [] cycle_time = [] init_time ...
31.321053
101
0.603428
import numpy as np import rosbag import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from tf.transformations import euler_from_quaternion bag = rosbag.Bag('2021-09-21-19-57-22.bag') x = [] y = [] z = [] roll = [] pitch = [] yaw = [] time = [] cycles = [] cycle_time = [] init_time = 0 for topic,...
true
true
f7409f45daac33af68428cd523b8c7bf33613292
21,647
py
Python
sdk/python/pulumi_google_native/compute/v1/instance_iam_policy.py
AaronFriel/pulumi-google-native
75d1cda425e33d4610348972cd70bddf35f1770d
[ "Apache-2.0" ]
44
2021-04-18T23:00:48.000Z
2022-02-14T17:43:15.000Z
sdk/python/pulumi_google_native/compute/v1/instance_iam_policy.py
AaronFriel/pulumi-google-native
75d1cda425e33d4610348972cd70bddf35f1770d
[ "Apache-2.0" ]
354
2021-04-16T16:48:39.000Z
2022-03-31T17:16:39.000Z
sdk/python/pulumi_google_native/compute/v1/instance_iam_policy.py
AaronFriel/pulumi-google-native
75d1cda425e33d4610348972cd70bddf35f1770d
[ "Apache-2.0" ]
8
2021-04-24T17:46:51.000Z
2022-01-05T10:40:21.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
74.388316
1,118
0.699496
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . import outputs from ._enums import * from ._inputs import * __all__ = ['InstanceIamPolicyArgs', 'InstanceIamPolicy'] @pulumi.input_type class InstanceIamPolicy...
true
true
f7409f4eaae89d3c6ff2e7cfb8808712be74ed5c
12,386
py
Python
pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside6.py
secantsquared/pyqtgraph
3ef7f5b91639543e43bcd66a84290fb9bc18fc5c
[ "MIT" ]
null
null
null
pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside6.py
secantsquared/pyqtgraph
3ef7f5b91639543e43bcd66a84290fb9bc18fc5c
[ "MIT" ]
null
null
null
pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyside6.py
secantsquared/pyqtgraph
3ef7f5b91639543e43bcd66a84290fb9bc18fc5c
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'plotConfigTemplate.ui' ## ## Created by: Qt User Interface Compiler version 6.1.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ########...
48.76378
242
0.708865
self.alphaGroup = QGroupBox(Form) self.alphaGroup.setObjectName(u"alphaGroup") self.alphaGroup.setGeometry(QRect(10, 390, 234, 60)) self.alphaGroup.setCheckable(True) self.horizontalLayout = QHBoxLayout(self.alphaGroup) self.horizontalLayout.setObjectName(u"horizontalLayou...
true
true
f740a0cc1f8fb202a58c824b51793171338613d3
347
py
Python
motorodm/fields/object_id_field.py
rob-blackbourn/motorodm
c77e79bd2b11c896b9a971ba6a9c4947dce96163
[ "Apache-2.0" ]
null
null
null
motorodm/fields/object_id_field.py
rob-blackbourn/motorodm
c77e79bd2b11c896b9a971ba6a9c4947dce96163
[ "Apache-2.0" ]
null
null
null
motorodm/fields/object_id_field.py
rob-blackbourn/motorodm
c77e79bd2b11c896b9a971ba6a9c4947dce96163
[ "Apache-2.0" ]
null
null
null
from bson import ObjectId from .field import Field class ObjectIdField(Field): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def to_mongo(self, value): return ObjectId(value) if value else None async def from_mongo(self, value, resolver=None): return str...
23.133333
53
0.677233
from bson import ObjectId from .field import Field class ObjectIdField(Field): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def to_mongo(self, value): return ObjectId(value) if value else None async def from_mongo(self, value, resolver=None): return str...
true
true
f740a1ce279b58707c4fd78dbf8f15d6b2d3195e
266
py
Python
delivery/delivery/ext/config/__init__.py
Wprosdocimo/curso-flask
d7093793bdd4a9da236ab1766606e46d5e4c7369
[ "Unlicense" ]
null
null
null
delivery/delivery/ext/config/__init__.py
Wprosdocimo/curso-flask
d7093793bdd4a9da236ab1766606e46d5e4c7369
[ "Unlicense" ]
null
null
null
delivery/delivery/ext/config/__init__.py
Wprosdocimo/curso-flask
d7093793bdd4a9da236ab1766606e46d5e4c7369
[ "Unlicense" ]
null
null
null
def init_app(app): app.config["SECRET_KEY"] = "abacate01" app.config["SQLALCHEMY_DATABASE_URI"] = 'sqlite:///delivery.db' if app.debug: app.config['DEBUG_TB_TEMPLATE_EDITOR_ENABLED'] = True app.config['DEBUG_TB_PROFILER_ENABLED'] = True
33.25
67
0.68797
def init_app(app): app.config["SECRET_KEY"] = "abacate01" app.config["SQLALCHEMY_DATABASE_URI"] = 'sqlite:///delivery.db' if app.debug: app.config['DEBUG_TB_TEMPLATE_EDITOR_ENABLED'] = True app.config['DEBUG_TB_PROFILER_ENABLED'] = True
true
true
f740a27fb79c8586fdc8e5d632c3e0d223d5706a
6,549
py
Python
spark_fhir_schemas/stu3/complex_types/coding.py
icanbwell/SparkFhirSchemas
8c828313c39850b65f8676e67f526ee92b7d624e
[ "Apache-2.0" ]
2
2020-10-31T23:25:01.000Z
2021-06-09T14:12:42.000Z
spark_fhir_schemas/stu3/complex_types/coding.py
icanbwell/SparkFhirSchemas
8c828313c39850b65f8676e67f526ee92b7d624e
[ "Apache-2.0" ]
null
null
null
spark_fhir_schemas/stu3/complex_types/coding.py
icanbwell/SparkFhirSchemas
8c828313c39850b65f8676e67f526ee92b7d624e
[ "Apache-2.0" ]
null
null
null
from typing import Union, List, Optional from pyspark.sql.types import ( StructType, StructField, StringType, ArrayType, BooleanType, DataType, ) # This file is auto-generated by generate_schema so do not edit manually # noinspection PyPep8Naming class CodingSchema: """ A reference to...
45.165517
96
0.592915
from typing import Union, List, Optional from pyspark.sql.types import ( StructType, StructField, StringType, ArrayType, BooleanType, DataType, ) class CodingSchema: @staticmethod def get_schema( max_nesting_depth: Optional[int] = 6, nesting_depth: int = 0, ...
true
true
f740a2eacc84f38fa36d15e7d6de98de7d4cd37f
229
py
Python
tests/sphinx_ext/utils.py
arareko/conformity
a24d6027e7195d20c43065a06f610182a16fe9cd
[ "Apache-2.0" ]
26
2017-07-03T04:52:35.000Z
2021-08-15T00:19:00.000Z
tests/sphinx_ext/utils.py
arareko/conformity
a24d6027e7195d20c43065a06f610182a16fe9cd
[ "Apache-2.0" ]
16
2017-05-01T19:31:56.000Z
2019-10-10T14:22:01.000Z
tests/sphinx_ext/utils.py
arareko/conformity
a24d6027e7195d20c43065a06f610182a16fe9cd
[ "Apache-2.0" ]
8
2019-05-13T17:48:24.000Z
2021-09-08T11:27:39.000Z
from __future__ import ( absolute_import, unicode_literals, ) import functools def decorated(func): @functools.wraps(func) def wrapper(*args, **kwargs): return func(*args, **kwargs) return wrapper
15.266667
36
0.668122
from __future__ import ( absolute_import, unicode_literals, ) import functools def decorated(func): @functools.wraps(func) def wrapper(*args, **kwargs): return func(*args, **kwargs) return wrapper
true
true
f740a43a893f47bb47896118e7a0b20d8545edbc
7,280
py
Python
tslib/__init__.py
mpetazzoni/tslib
8cafb834401c39149049c56bc1e78d8a4cdf1cb6
[ "Apache-2.0" ]
null
null
null
tslib/__init__.py
mpetazzoni/tslib
8cafb834401c39149049c56bc1e78d8a4cdf1cb6
[ "Apache-2.0" ]
null
null
null
tslib/__init__.py
mpetazzoni/tslib
8cafb834401c39149049c56bc1e78d8a4cdf1cb6
[ "Apache-2.0" ]
1
2020-12-11T13:55:53.000Z
2020-12-11T13:55:53.000Z
# Copyright (C) 2015-2019 SignalFx, Inc. All rights reserved. # Copyright (C) 2020-2021 Splunk, Inc. All rights reserved. from __future__ import print_function import argparse import calendar from datetime import datetime as dt from datetime import timedelta as delta import os import pytz import re import six import ...
31.652174
79
0.607967
from __future__ import print_function import argparse import calendar from datetime import datetime as dt from datetime import timedelta as delta import os import pytz import re import six import sys from . import version __author__ = 'Maxime Petazzoni <max@signalfuse.com>' __copyright__ = 'Copyright (C) 2015 Si...
true
true
f740a4a6987b3f1ac23b401ea751a754cf37ce2d
1,135
py
Python
test/test_package_version_resource.py
cvent/octopus-deploy-api-client
0e03e842e1beb29b132776aee077df570b88366a
[ "Apache-2.0" ]
null
null
null
test/test_package_version_resource.py
cvent/octopus-deploy-api-client
0e03e842e1beb29b132776aee077df570b88366a
[ "Apache-2.0" ]
null
null
null
test/test_package_version_resource.py
cvent/octopus-deploy-api-client
0e03e842e1beb29b132776aee077df570b88366a
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Octopus Server API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 2019.6.7+Branch.tags-2019.6.7.Sha.aa18dc6809953218c66f57eff7d26481d9b23d6a Generated by: https://github.com/swagger-api...
27.682927
119
0.753304
from __future__ import absolute_import import unittest import octopus_deploy_swagger_client from octopus_deploy_swagger_client.models.package_version_resource import PackageVersionResource from octopus_deploy_swagger_client.rest import ApiException class TestPackageVersionResource(unittest.TestCase): def...
true
true
f740a5c65f1abcb18c4bc57fcab42b6dda732540
4,647
py
Python
src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py
chef-davin/azure-cli
2ebd33d5f69a27d07404cc48cf475d5fbdda6378
[ "MIT" ]
null
null
null
src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py
chef-davin/azure-cli
2ebd33d5f69a27d07404cc48cf475d5fbdda6378
[ "MIT" ]
1
2021-06-02T02:38:22.000Z
2021-06-02T02:38:22.000Z
src/azure-cli-core/azure/cli/core/extension/tests/latest/test_wheel_type_extension.py
chef-davin/azure-cli
2ebd33d5f69a27d07404cc48cf475d5fbdda6378
[ "MIT" ]
null
null
null
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
43.027778
118
0.667743
import os import tempfile import zipfile import tarfile import shutil import unittest from azure.cli.core.extension import WheelExtension from azure.cli.core.extension.tests.latest import ExtensionTypeTestMixin, get_test_data_file class TestWheelTypeExtensionMetadata(ExtensionTypeTestMixin): def test_readi...
true
true
f740a5f16141c263aa7fbec51acca6a70543f06f
3,509
py
Python
homeassistant/components/switch/tplink.py
Norien/Home-Assistant
0aa8933df675aa3ea93126c0b1eb7c9a77208331
[ "Apache-2.0" ]
2
2017-02-25T00:27:06.000Z
2017-02-25T03:09:30.000Z
homeassistant/components/switch/tplink.py
Norien/Home-Assistant
0aa8933df675aa3ea93126c0b1eb7c9a77208331
[ "Apache-2.0" ]
null
null
null
homeassistant/components/switch/tplink.py
Norien/Home-Assistant
0aa8933df675aa3ea93126c0b1eb7c9a77208331
[ "Apache-2.0" ]
null
null
null
""" Support for TPLink HS100/HS110/HS200 smart switch. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.tplink/ """ import logging import time import voluptuous as vol from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA) fr...
31.053097
78
0.629524
import logging import time import voluptuous as vol from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA) from homeassistant.const import (CONF_HOST, CONF_NAME) import homeassistant.helpers.config_validation as cv REQUIREMENTS = ['pyHS100==0.2.3'] _LOGGER = logging.getLogger(__name__) ATTR_C...
true
true
f740a8344d89fd8edeb1d9f25d44b6de79cdb537
2,662
py
Python
puppet/modules/backflips/files/backflips/implant.py
gavz/redteam-infra
79a1feafc2efe46b555cf7333c91c32bd68e1bad
[ "Apache-2.0" ]
56
2019-02-09T10:41:06.000Z
2022-03-25T23:58:37.000Z
puppet/modules/backflips/files/backflips/implant.py
gavz/redteam-infra
79a1feafc2efe46b555cf7333c91c32bd68e1bad
[ "Apache-2.0" ]
52
2018-11-08T21:22:52.000Z
2020-02-16T18:14:34.000Z
puppet/modules/backflips/files/backflips/implant.py
gavz/redteam-infra
79a1feafc2efe46b555cf7333c91c32bd68e1bad
[ "Apache-2.0" ]
17
2018-11-19T03:39:11.000Z
2021-09-16T21:51:59.000Z
import sys, os, time, atexit, socket, subprocess from signal import SIGTERM import logging fqdn = 'FQDN_PLACEHOLDER' port = 'PORT_PLACEHOLDER' keyfile = 'KEYFILE_PLACEHOLDER' if __name__ == '__main__': try: pid = os.fork() if pid > 0: # exit first parent sys.exit(0) ex...
32.463415
127
0.555222
import sys, os, time, atexit, socket, subprocess from signal import SIGTERM import logging fqdn = 'FQDN_PLACEHOLDER' port = 'PORT_PLACEHOLDER' keyfile = 'KEYFILE_PLACEHOLDER' if __name__ == '__main__': try: pid = os.fork() if pid > 0: sys.exit(0) except OSError, e: ...
false
true
f740a92024db78aef6a002c14abc6cca91e560c0
2,964
py
Python
src/python/WMCore/BossAir/MySQL/JobStatusForMonitoring.py
hufnagel/WMCore
b150cc725b68fc1cf8e6e0fa07c826226a4421fa
[ "Apache-2.0" ]
1
2015-02-05T13:43:46.000Z
2015-02-05T13:43:46.000Z
src/python/WMCore/BossAir/MySQL/JobStatusForMonitoring.py
hufnagel/WMCore
b150cc725b68fc1cf8e6e0fa07c826226a4421fa
[ "Apache-2.0" ]
1
2016-10-13T14:57:35.000Z
2016-10-13T14:57:35.000Z
src/python/WMCore/BossAir/MySQL/JobStatusForMonitoring.py
hufnagel/WMCore
b150cc725b68fc1cf8e6e0fa07c826226a4421fa
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """ _JobStatusMonitoring_ MySQL implementation for loading a job by scheduler status """ from WMCore.Database.DBFormatter import DBFormatter class JobStatusForMonitoring(DBFormatter): """ _LoadForMonitoring_ Load all jobs with a certain scheduler status including all the joine...
36.592593
86
0.606613
from WMCore.Database.DBFormatter import DBFormatter class JobStatusForMonitoring(DBFormatter): sql = """SELECT STRAIGHT_JOIN wwf.name as workflow, count(rj.wmbs_id) AS num_jobs, st.name AS status, wl.plugin AS plugin, wu.cert_dn AS owner FROM bl_runjob rj LEFT...
true
true
f740a96ff6c044923f1adc4849b3807cc475fd3d
18,079
py
Python
adapya/era/scripts/inq.py
SoftwareAG/adapya-era
6b12b44527fe2d02e3614c18e9e47cd237793b23
[ "Apache-2.0" ]
null
null
null
adapya/era/scripts/inq.py
SoftwareAG/adapya-era
6b12b44527fe2d02e3614c18e9e47cd237793b23
[ "Apache-2.0" ]
null
null
null
adapya/era/scripts/inq.py
SoftwareAG/adapya-era
6b12b44527fe2d02e3614c18e9e47cd237793b23
[ "Apache-2.0" ]
null
null
null
#! /usr/bin/env python # -*- coding: latin1 -*- """ ---- inq.py -- Reptor input queue writer ---- Write messages to the Reptor input queue via EntireX Broker ACI call interface Usage: python inq.py [options] Options: -h, --help display this help -b, --broker .. id of broker ETBxxxxx ...
31.829225
90
0.549864
from __future__ import print_function import sys, time, getopt from adapya.base import datamap from adapya.era import reptor from adapya.entirex.broker import Broker,OPT_COMMIT tap=0 msgn=0 if sys.hexversion > 0x03010100: long = int def reqOpen(dest='', rdest='', token=''): global bb ...
true
true
f740aab5e17d64461d602d94500053566a5a3e2b
7,150
py
Python
src/python/dart/web/api/engine.py
RetailMeNotSandbox/dart
58a05f56c04fadd6741501262d92aeb143cd2f2e
[ "MIT" ]
18
2016-03-03T19:10:21.000Z
2021-07-14T22:37:35.000Z
src/python/dart/web/api/engine.py
RetailMeNotSandbox/dart
58a05f56c04fadd6741501262d92aeb143cd2f2e
[ "MIT" ]
62
2016-04-11T15:17:23.000Z
2017-09-08T17:18:53.000Z
src/python/dart/web/api/engine.py
RetailMeNotSandbox/dart
58a05f56c04fadd6741501262d92aeb143cd2f2e
[ "MIT" ]
15
2016-03-03T15:38:34.000Z
2019-03-27T19:33:08.000Z
import json from flask import Blueprint, request, current_app from flask.ext.jsontools import jsonapi from flask.ext.login import login_required from dart.auth.required_roles import required_roles from dart.message.trigger_proxy import TriggerProxy from dart.model.action import ActionState from dart.model.engine impo...
32.207207
119
0.742517
import json from flask import Blueprint, request, current_app from flask.ext.jsontools import jsonapi from flask.ext.login import login_required from dart.auth.required_roles import required_roles from dart.message.trigger_proxy import TriggerProxy from dart.model.action import ActionState from dart.model.engine impo...
true
true
f740ab0a7b7c56b89d33a7adfff022f6a8c5d553
438
py
Python
Q1344.py
Linchin/python_leetcode_git
3d08ab04bbdbd2ce268f33c501fbb149662872c7
[ "MIT" ]
null
null
null
Q1344.py
Linchin/python_leetcode_git
3d08ab04bbdbd2ce268f33c501fbb149662872c7
[ "MIT" ]
null
null
null
Q1344.py
Linchin/python_leetcode_git
3d08ab04bbdbd2ce268f33c501fbb149662872c7
[ "MIT" ]
null
null
null
""" 1344 medium angle between hands of a clock """ class Solution: def angleClock(self, hour: int, minutes: int) -> float: min_angle = minutes * 6 hour_angle = hour * 30 + minutes / 2 hand_angles = abs(min_angle - hour_angle) if hand_angles > 180: hand_angles = 360 - ...
18.25
59
0.625571
class Solution: def angleClock(self, hour: int, minutes: int) -> float: min_angle = minutes * 6 hour_angle = hour * 30 + minutes / 2 hand_angles = abs(min_angle - hour_angle) if hand_angles > 180: hand_angles = 360 - hand_angles return hand_angles sol = Solu...
true
true
f740ac4142cdf6e3ce0cd700b916f6337b170f2c
379
py
Python
code-everyday-challenge/n29_sum_n.py
ved93/deliberate-practice-challenges
2fccdbb9d2baaa16f888055c081a8d04804c0045
[ "MIT" ]
null
null
null
code-everyday-challenge/n29_sum_n.py
ved93/deliberate-practice-challenges
2fccdbb9d2baaa16f888055c081a8d04804c0045
[ "MIT" ]
null
null
null
code-everyday-challenge/n29_sum_n.py
ved93/deliberate-practice-challenges
2fccdbb9d2baaa16f888055c081a8d04804c0045
[ "MIT" ]
null
null
null
def countConsecutive(N): # constraint on values of L gives us the # time Complexity as O(N^0.5) count = 0 L = 1 while( L * (L + 1) < 2 * N): a = (1.0 * N - (L * (L + 1) ) / 2) / (L + 1) if (a - int(a) == 0.0): count += 1 L += 1 return cou...
16.478261
53
0.427441
def countConsecutive(N): count = 0 L = 1 while( L * (L + 1) < 2 * N): a = (1.0 * N - (L * (L + 1) ) / 2) / (L + 1) if (a - int(a) == 0.0): count += 1 L += 1 return count N = 15 print(countConsecutive(N))
true
true
f740ac67103a6b45b261106bbf37463c3bbaac79
35,243
py
Python
coremltools/models/_graph_visualization.py
kizill/coremltools
11e143089a66ee219ce3a2ed98aa1aae794d4794
[ "BSD-3-Clause" ]
null
null
null
coremltools/models/_graph_visualization.py
kizill/coremltools
11e143089a66ee219ce3a2ed98aa1aae794d4794
[ "BSD-3-Clause" ]
null
null
null
coremltools/models/_graph_visualization.py
kizill/coremltools
11e143089a66ee219ce3a2ed98aa1aae794d4794
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2017, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause """ Functions related to graph visualization of mlmodels """ import ast as _ast import json as _json im...
43.780124
129
0.576483
import ast as _ast import json as _json import os as _os import numpy as _np from ._infer_shapes_nn_mlmodel import infer_shapes as _infer_shapes from coremltools.proto import NeuralNetwork_pb2 as _NeuralNetwork_pb2 def _calculate_edges(cy_nodes, cy_edges, shape_dict=None): node_len = len(cy_nodes) for ...
true
true
f740acfc8edc3484bea80f46732a075ec258e256
2,481
py
Python
src/compas_rhino/uninstall_plugin.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
null
null
null
src/compas_rhino/uninstall_plugin.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
null
null
null
src/compas_rhino/uninstall_plugin.py
funkchaser/compas
b58de8771484aa0c6068d43df78b1679503215de
[ "MIT" ]
null
null
null
from __future__ import print_function from __future__ import absolute_import from __future__ import division import os import compas_rhino from compas._os import remove_symlink __all__ = ['uninstall_plugin'] def uninstall_plugin(plugin, version=None): """Uninstall a Rhino Python Command Plugin. Paramete...
25.57732
83
0.585248
from __future__ import print_function from __future__ import absolute_import from __future__ import division import os import compas_rhino from compas._os import remove_symlink __all__ = ['uninstall_plugin'] def uninstall_plugin(plugin, version=None): version = compas_rhino._check_rhino_version(version) ...
true
true
f740ae3b0e5ab6c9e3870fd96f1dcc6a4352536a
65,014
py
Python
cinder/volume/drivers/rbd.py
etaivan/stx-cinder
58f54bd42e4bc352ae96ea1f9df9e9dc71e461a3
[ "Apache-2.0" ]
null
null
null
cinder/volume/drivers/rbd.py
etaivan/stx-cinder
58f54bd42e4bc352ae96ea1f9df9e9dc71e461a3
[ "Apache-2.0" ]
null
null
null
cinder/volume/drivers/rbd.py
etaivan/stx-cinder
58f54bd42e4bc352ae96ea1f9df9e9dc71e461a3
[ "Apache-2.0" ]
null
null
null
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
42.409654
79
0.575707
from __future__ import absolute_import import json import math import os import tempfile from eventlet import tpool from oslo_config import cfg from oslo_log import log as logging from oslo_utils import fileutils from oslo_utils import units import six from six.moves import urllib from cinder import exc...
true
true
f740afbd38d94cd86863cea699cfb26fe86204bc
496
py
Python
examples/getAUsersVideos.py
alancraft2002/tiktokScraper
7f46a774eedf5e25940505d01fbe2712bf19812a
[ "MIT" ]
9
2020-11-12T07:32:39.000Z
2021-09-07T10:39:11.000Z
examples/getAUsersVideos.py
alancraft2002/tiktokScraper
7f46a774eedf5e25940505d01fbe2712bf19812a
[ "MIT" ]
null
null
null
examples/getAUsersVideos.py
alancraft2002/tiktokScraper
7f46a774eedf5e25940505d01fbe2712bf19812a
[ "MIT" ]
3
2021-01-18T02:31:04.000Z
2021-11-30T23:16:03.000Z
from TikTokApi import TikTokApi # Starts TikTokApi api = TikTokApi.get_instance() # The Number of trending TikToks you want to be displayed results = 10 # Returns a list of dictionaries of the trending object userPosts = api.userPosts( "6745191554350760966", "MS4wLjABAAAAM3R2BtjzVT-uAtstkl2iugMzC6AtnpkojJbji...
23.619048
83
0.764113
from TikTokApi import TikTokApi api = TikTokApi.get_instance() results = 10 userPosts = api.userPosts( "6745191554350760966", "MS4wLjABAAAAM3R2BtjzVT-uAtstkl2iugMzC6AtnpkojJbjiOdDDrdsTiTR75-8lyWJCY5VvDrZ", 30, ) for tiktok in userPosts: print(tiktok["desc"]) print(len(userPosts))
true
true
f740b0970201a6d8b8fdfbe3c4d3f6ec97718acd
5,819
py
Python
Examples/Tensorboard/SimpleMNIST.py
catycaldwell/CNTK
86a20080b19255b96ada85b6a7ab6b8e7be7465b
[ "RSA-MD" ]
null
null
null
Examples/Tensorboard/SimpleMNIST.py
catycaldwell/CNTK
86a20080b19255b96ada85b6a7ab6b8e7be7465b
[ "RSA-MD" ]
null
null
null
Examples/Tensorboard/SimpleMNIST.py
catycaldwell/CNTK
86a20080b19255b96ada85b6a7ab6b8e7be7465b
[ "RSA-MD" ]
1
2021-01-21T05:58:03.000Z
2021-01-21T05:58:03.000Z
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== import numpy as np import sys import os from cntk import Trainer from cntk.io import...
43.75188
119
0.706994
import numpy as np import sys import os from cntk import Trainer from cntk.io import MinibatchSource, CTFDeserializer, StreamDef, StreamDefs, INFINITELY_REPEAT, FULL_DATA_SWEEP from cntk.learner import sgd, learning_rate_schedule, UnitType from cntk.ops import input_variable, cross_entropy_with_softmax, classifica...
true
true
f740b1511160d9a755d88c1f3b7c6973861cdceb
4,460
py
Python
tests/cases/specified_location.py
riels89/gunpowder
e523b49ca846a9fd46ab6fc0dd1040cc4a4d53b4
[ "MIT" ]
null
null
null
tests/cases/specified_location.py
riels89/gunpowder
e523b49ca846a9fd46ab6fc0dd1040cc4a4d53b4
[ "MIT" ]
null
null
null
tests/cases/specified_location.py
riels89/gunpowder
e523b49ca846a9fd46ab6fc0dd1040cc4a4d53b4
[ "MIT" ]
null
null
null
# from .provider_test import ProviderTest, TestSource from gunpowder import (BatchProvider, ArrayKeys, ArraySpec, Roi, Batch, Coordinate, SpecifiedLocation, build, BatchRequest, Array, ArrayKey) import numpy as np import unittest class TestSourceSpecifiedLocation(BatchPro...
30.758621
79
0.465022
from gunpowder import (BatchProvider, ArrayKeys, ArraySpec, Roi, Batch, Coordinate, SpecifiedLocation, build, BatchRequest, Array, ArrayKey) import numpy as np import unittest class TestSourceSpecifiedLocation(BatchProvider): def __init__(self, roi, voxel_size): ...
true
true
f740b3006beea47d3d941af6c052a97016d87f3c
377
py
Python
setup.py
yang-lina/Bayesian-Hierarchical-Clustering
2e35d3c3d59e33cd851f8497d1cd592d601b8fbb
[ "MIT" ]
1
2019-09-23T18:51:58.000Z
2019-09-23T18:51:58.000Z
setup.py
yang-lina/Bayesian-Hierarchical-Clustering
2e35d3c3d59e33cd851f8497d1cd592d601b8fbb
[ "MIT" ]
null
null
null
setup.py
yang-lina/Bayesian-Hierarchical-Clustering
2e35d3c3d59e33cd851f8497d1cd592d601b8fbb
[ "MIT" ]
1
2020-05-08T17:42:37.000Z
2020-05-08T17:42:37.000Z
from setuptools import setup setup(name='bhc', version='0.1', description='Bayesian Hierarchical Clustering', url='https://github.com/qxxxd/bhc', author='Xiaodi Qin, Lina Yang', author_email='xq24@duke.edu, ly81@duke.edu', license='MIT', packages=['bhc'], #install_requir...
29
55
0.6313
from setuptools import setup setup(name='bhc', version='0.1', description='Bayesian Hierarchical Clustering', url='https://github.com/qxxxd/bhc', author='Xiaodi Qin, Lina Yang', author_email='xq24@duke.edu, ly81@duke.edu', license='MIT', packages=['bhc'], zip_safe...
true
true
f740b4a6de67809102d31bcb999d40f6b0552ee3
26,390
py
Python
ocpmodels/trainers/forces_trainer.py
joshes/ocp
e04056d008616eaf5058b7851d8ac29b8f2da473
[ "MIT" ]
null
null
null
ocpmodels/trainers/forces_trainer.py
joshes/ocp
e04056d008616eaf5058b7851d8ac29b8f2da473
[ "MIT" ]
null
null
null
ocpmodels/trainers/forces_trainer.py
joshes/ocp
e04056d008616eaf5058b7851d8ac29b8f2da473
[ "MIT" ]
null
null
null
""" Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ import os from collections import defaultdict import numpy as np import torch import torch_geometric from torch.utils.data import DataLoader...
39.096296
127
0.49712
import os from collections import defaultdict import numpy as np import torch import torch_geometric from torch.utils.data import DataLoader, DistributedSampler from tqdm import tqdm from ocpmodels.common import distutils from ocpmodels.common.data_parallel import ParallelCollater from ocpmodels.common.registry impo...
true
true
f740b63c7bc14f574b50ee3c0a68be13ac07f114
6,076
py
Python
django/core/checks/security/base.py
bpeschier/django
f54c0ec06e390dc5bce95fdccbcb51d6423da4f9
[ "BSD-3-Clause" ]
39
2016-12-05T14:36:37.000Z
2021-07-29T18:22:34.000Z
django/core/checks/security/base.py
bpeschier/django
f54c0ec06e390dc5bce95fdccbcb51d6423da4f9
[ "BSD-3-Clause" ]
68
2016-12-12T20:38:47.000Z
2020-07-26T18:28:49.000Z
django/core/checks/security/base.py
bpeschier/django
f54c0ec06e390dc5bce95fdccbcb51d6423da4f9
[ "BSD-3-Clause" ]
120
2016-08-18T14:53:03.000Z
2020-06-16T13:27:20.000Z
from django.conf import settings from .. import Tags, Warning, register SECRET_KEY_MIN_LENGTH = 50 SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5 W001 = Warning( "You do not have 'django.middleware.security.SecurityMiddleware' " "in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, " "SECURE_CONTENT_TYPE_NOSNIFF...
32.843243
98
0.717742
from django.conf import settings from .. import Tags, Warning, register SECRET_KEY_MIN_LENGTH = 50 SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5 W001 = Warning( "You do not have 'django.middleware.security.SecurityMiddleware' " "in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, " "SECURE_CONTENT_TYPE_NOSNIFF...
true
true
f740b71e6b91cf892d29dabb0041c1e46760b9cc
5,955
py
Python
leetcode_python/Two_Pointers/linked-list-cycle-ii.py
yennanliu/Python_basics
6a597442d39468295946cefbfb11d08f61424dc3
[ "Unlicense" ]
null
null
null
leetcode_python/Two_Pointers/linked-list-cycle-ii.py
yennanliu/Python_basics
6a597442d39468295946cefbfb11d08f61424dc3
[ "Unlicense" ]
null
null
null
leetcode_python/Two_Pointers/linked-list-cycle-ii.py
yennanliu/Python_basics
6a597442d39468295946cefbfb11d08f61424dc3
[ "Unlicense" ]
null
null
null
""" 142. Linked List Cycle II Medium Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote t...
27.068182
322
0.560705
class Solution: def detectCycle(self, head): if not head or not head.next: return slow = fast = head while fast and fast.next: fast = fast.next.next slow = slow.next if fast == slow: break fast = fast....
true
true
f740b752199af7ec414cd7d1064ff044c6624ece
1,595
py
Python
pythonProject/roman_numerals.py
irisxiu666/5001
07ea4bac4fa7c1f961d93bdd9723716b2452adc4
[ "MIT" ]
null
null
null
pythonProject/roman_numerals.py
irisxiu666/5001
07ea4bac4fa7c1f961d93bdd9723716b2452adc4
[ "MIT" ]
null
null
null
pythonProject/roman_numerals.py
irisxiu666/5001
07ea4bac4fa7c1f961d93bdd9723716b2452adc4
[ "MIT" ]
null
null
null
""" A program that is able to convert a number between 1 and 4999 (inclusive) to a roman numeral with variables, arithmetic operators, and functions.""" def main(): # Input the number number = roman_num = int(input('Enter number:')) # The quotient gotten from 'number // 1000' is the number of 'M' ...
35.444444
78
0.611912
def main(): number = roman_num = int(input('Enter number:')) num1 = number // 1000 roman_num1 = 'M' * num1 number = number - num1 * 1000 num2 = number // 500 roman_num2 = roman_num1 + 'D' * num2 number = number - num2 * 500 num3 = number // 100 ro...
true
true
f740b7f3d03a1b2995262ece22252fd841730468
395
py
Python
djangoapi/asgi.py
Shaurov05/Django-Crating-Rest-API
35ced6e659ad6773896df2136fe4942ba90c5daf
[ "MIT" ]
null
null
null
djangoapi/asgi.py
Shaurov05/Django-Crating-Rest-API
35ced6e659ad6773896df2136fe4942ba90c5daf
[ "MIT" ]
null
null
null
djangoapi/asgi.py
Shaurov05/Django-Crating-Rest-API
35ced6e659ad6773896df2136fe4942ba90c5daf
[ "MIT" ]
null
null
null
""" ASGI config for djangoapi project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SET...
23.235294
78
0.787342
import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoapi.settings') application = get_asgi_application()
true
true
f740b90fa221bacddecb568df1122025bc9618c1
511
py
Python
code/3.Longest-Substring-Without-Repeating-Characters-v2.py
Aden-Q/leetcode
ebd4804edd4f172b9981b22c18d9ff654cf20762
[ "Apache-2.0" ]
1
2019-09-22T03:08:14.000Z
2019-09-22T03:08:14.000Z
code/3.Longest-Substring-Without-Repeating-Characters-v2.py
Aden-Q/leetcode
ebd4804edd4f172b9981b22c18d9ff654cf20762
[ "Apache-2.0" ]
null
null
null
code/3.Longest-Substring-Without-Repeating-Characters-v2.py
Aden-Q/leetcode
ebd4804edd4f172b9981b22c18d9ff654cf20762
[ "Apache-2.0" ]
null
null
null
from collections import Counter class Solution: def lengthOfLongestSubstring(self, s: str) -> int: if len(s) == 0: return 0 max_length = 0 window = Counter() left = 0 right = left while right < len(s): window[s[right]] += 1 while wi...
30.058824
58
0.485323
from collections import Counter class Solution: def lengthOfLongestSubstring(self, s: str) -> int: if len(s) == 0: return 0 max_length = 0 window = Counter() left = 0 right = left while right < len(s): window[s[right]] += 1 while wi...
true
true
f740b93d64f490290c0b9732bc40769728c8d7a4
1,879
py
Python
acme/setup.py
jo-so/certbot
6d19d4df1e3e187d22fc3270cc4679611d3a7a17
[ "Apache-2.0" ]
null
null
null
acme/setup.py
jo-so/certbot
6d19d4df1e3e187d22fc3270cc4679611d3a7a17
[ "Apache-2.0" ]
null
null
null
acme/setup.py
jo-so/certbot
6d19d4df1e3e187d22fc3270cc4679611d3a7a17
[ "Apache-2.0" ]
null
null
null
import sys from setuptools import find_packages from setuptools import setup version = '1.18.0' install_requires = [ # This dependency just exists to ensure that chardet is installed along # with requests so it will use it instead of charset_normalizer. See # https://github.com/certbot/certbot/issues/896...
28.044776
78
0.63438
import sys from setuptools import find_packages from setuptools import setup version = '1.18.0' install_requires = [ 'chardet', 'cryptography>=2.1.4', 'josepy>=1.1.0', 'PyOpenSSL>=17.3.0', 'pyrfc3339', 'pytz', 'requests>=2.14.2', 'requests-toolbelt>=0.3.0...
true
true
f740bb2a40e9bb5271037b110ef77b798f7b39c9
3,083
py
Python
oh-my-zsh/custom/plugins/vcs-prompt/lib/gitstatus-fast.py
grantr/dotfiles
39f6395de4b448db19a7e024e986bb1f5a3035f5
[ "MIT" ]
null
null
null
oh-my-zsh/custom/plugins/vcs-prompt/lib/gitstatus-fast.py
grantr/dotfiles
39f6395de4b448db19a7e024e986bb1f5a3035f5
[ "MIT" ]
null
null
null
oh-my-zsh/custom/plugins/vcs-prompt/lib/gitstatus-fast.py
grantr/dotfiles
39f6395de4b448db19a7e024e986bb1f5a3035f5
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys import shlex from subprocess import Popen, PIPE, \ check_call, CalledProcessError def run_cmd(cmd, ignore_error=False, exargs=[]): cmd = shlex.split(cmd) cmd.extend(exargs) p = Popen(cmd, stdout=PIPE, std...
26.577586
91
0.614661
from __future__ import print_function import sys import shlex from subprocess import Popen, PIPE, \ check_call, CalledProcessError def run_cmd(cmd, ignore_error=False, exargs=[]): cmd = shlex.split(cmd) cmd.extend(exargs) p = Popen(cmd, stdout=PIPE, stderr=PIPE) out, error = p.communicate() ...
true
true
f740bb3eb660cfad12dbb93a1458e8e12e24c345
2,675
py
Python
saw/llvm_types.py
GaloisInc/galois-py-toolk
101cc00e02c27b9f115d5ea1f6b8af6f0dcea856
[ "BSD-3-Clause" ]
null
null
null
saw/llvm_types.py
GaloisInc/galois-py-toolk
101cc00e02c27b9f115d5ea1f6b8af6f0dcea856
[ "BSD-3-Clause" ]
10
2021-02-15T16:41:42.000Z
2021-03-12T19:36:41.000Z
saw/llvm_types.py
GaloisInc/galois-py-toolk
101cc00e02c27b9f115d5ea1f6b8af6f0dcea856
[ "BSD-3-Clause" ]
2
2021-02-15T14:35:43.000Z
2021-02-18T19:08:22.000Z
from abc import ABCMeta, abstractmethod from typing import Any, List class LLVMType(metaclass=ABCMeta): @abstractmethod def to_json(self) -> Any: pass class LLVMIntType(LLVMType): def __init__(self, width : int) -> None: self.width = width def to_json(self) -> Any: return {'type': 'pr...
31.845238
85
0.608598
from abc import ABCMeta, abstractmethod from typing import Any, List class LLVMType(metaclass=ABCMeta): @abstractmethod def to_json(self) -> Any: pass class LLVMIntType(LLVMType): def __init__(self, width : int) -> None: self.width = width def to_json(self) -> Any: return {'type': 'pr...
true
true
f740bb7304d7ec0cbc752401120e1817691f24cf
3,438
py
Python
DataManager/Legacy/create_dataset/generate_mask_db.py
naivelogic/ZeroWaste3D
915d4a37563db8481c8631ab0e34cfd0512941f8
[ "MIT" ]
2
2020-10-15T05:05:02.000Z
2020-10-22T23:44:18.000Z
DataManager/Legacy/create_dataset/generate_mask_db.py
naivelogic/ZeroWaste3D
915d4a37563db8481c8631ab0e34cfd0512941f8
[ "MIT" ]
null
null
null
DataManager/Legacy/create_dataset/generate_mask_db.py
naivelogic/ZeroWaste3D
915d4a37563db8481c8631ab0e34cfd0512941f8
[ "MIT" ]
null
null
null
#%% import sys, os, glob import numpy as np sys.path.append("../") # go to parent dir from utils.coco_manager import MaskManager ## Create Train/Val/Test/ Datasets #Train: 80% #Val: 18% #Test: 2% #%% DATASET_VERSON = 'ds2' DATASET_PATH = f'/mnt/zerowastepublic/02-datasets/{DATASET_VERSON}/' DATASET_RAW_FOLD...
32.433962
283
0.688482
import sys, os, glob import numpy as np sys.path.append("../") from utils.coco_manager import MaskManager SET_PATH = f'/mnt/zerowastepublic/02-datasets/{DATASET_VERSON}/' DATASET_RAW_FOLDER = f'/mnt/zerowastepublic/02-datasets/{DATASET_VERSON}/raw/' DATASET_PATH = f'/mnt/daredevildiag/6PACK/z3d/ds1/InstanceGroup...
true
true
f740bc16934739fdbdee620920bfaacc5d07aabc
415
py
Python
auctions/migrations/0009_auto_20201030_1222.py
huutrungrimp/commerce
8a22ea44bfca69f96d721a3ebefd7729487db3cf
[ "MIT" ]
null
null
null
auctions/migrations/0009_auto_20201030_1222.py
huutrungrimp/commerce
8a22ea44bfca69f96d721a3ebefd7729487db3cf
[ "MIT" ]
null
null
null
auctions/migrations/0009_auto_20201030_1222.py
huutrungrimp/commerce
8a22ea44bfca69f96d721a3ebefd7729487db3cf
[ "MIT" ]
null
null
null
# Generated by Django 3.1.2 on 2020-10-30 16:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auctions', '0008_bidlisting_bidprice'), ] operations = [ migrations.AlterField( model_name='bidlisting', name='bidpr...
21.842105
71
0.619277
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('auctions', '0008_bidlisting_bidprice'), ] operations = [ migrations.AlterField( model_name='bidlisting', name='bidprice', field=models.DecimalField(dec...
true
true
f740bc89ba9d061020c4c245165a8c29189026b2
1,710
py
Python
Sprint-challenge/acme_test.py
iesous-kurios/DS-Unit-3-Sprint-1-Software-Engineering
391f0d34a8c96dd6f45390b9ae75f92197e3c413
[ "MIT" ]
null
null
null
Sprint-challenge/acme_test.py
iesous-kurios/DS-Unit-3-Sprint-1-Software-Engineering
391f0d34a8c96dd6f45390b9ae75f92197e3c413
[ "MIT" ]
null
null
null
Sprint-challenge/acme_test.py
iesous-kurios/DS-Unit-3-Sprint-1-Software-Engineering
391f0d34a8c96dd6f45390b9ae75f92197e3c413
[ "MIT" ]
null
null
null
import unittest from acme import Product, BoxingGlove from acme_report import generate_products, ADJECTIVES, NOUNS """Tests for Acme Python modules.""" class AcmeProductTests(unittest.TestCase): """Making sure Acme products are the tops!""" def test_default_product_price(self): """Test ...
34.2
75
0.649123
import unittest from acme import Product, BoxingGlove from acme_report import generate_products, ADJECTIVES, NOUNS class AcmeProductTests(unittest.TestCase): def test_default_product_price(self): prod = Product('Test Product') self.assertEqual(prod.price, 10) def test_default_...
true
true
f740bd521c46102471b2ba19e01976bf20455c3a
3,024
py
Python
assignment/min_nonsmooth_fun.py
bobrokerson/libraries
996509d341af7108a24053eb88431ec6afbb0f25
[ "MIT" ]
null
null
null
assignment/min_nonsmooth_fun.py
bobrokerson/libraries
996509d341af7108a24053eb88431ec6afbb0f25
[ "MIT" ]
null
null
null
assignment/min_nonsmooth_fun.py
bobrokerson/libraries
996509d341af7108a24053eb88431ec6afbb0f25
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 21 15:36:06 2022 @author: bobrokerson """ # part of code from task #1 from math import sin, exp import numpy as np import matplotlib.pyplot as plt def func(x): return sin(x / 5.) * exp(x / 10.) + 5. * exp(-x/ 2.) xarr = np.arange(1., 31.) p...
37.333333
371
0.732804
from math import sin, exp import numpy as np import matplotlib.pyplot as plt def func(x): return sin(x / 5.) * exp(x / 10.) + 5. * exp(-x/ 2.) xarr = np.arange(1., 31.) print(xarr) print("x:", xarr.shape) yarr = np.array([func(x) for x in xarr]) print(yarr) print("y:", yarr.shape) plt.plot(xarr, yarr) plt.gr...
true
true
f740bdd17578b084ff63e05e6fc3c2ca7fab9048
1,448
py
Python
src/test/ilcoin-util-test.py
ILCOINDevelopmentTeam/ilcoin-master
f6ceb8adcbd5db8d5cb8beeaf937ceb2d76bb3af
[ "MIT" ]
21
2021-01-17T06:44:12.000Z
2022-03-10T02:11:24.000Z
src/test/ilcoin-util-test.py
Borishbc/ilcoin-master
b03cebfb0296379252b991d4622c65d3628f965d
[ "MIT" ]
2
2020-06-22T12:41:52.000Z
2020-07-15T03:44:41.000Z
src/test/ilcoin-util-test.py
ILCoinDevTeam/ilcoin-master
f6ceb8adcbd5db8d5cb8beeaf937ceb2d76bb3af
[ "MIT" ]
10
2019-02-28T09:33:24.000Z
2020-09-17T11:37:59.000Z
#!/usr/bin/env python # Copyright 2014 BitPay Inc. # Copyright 2016 The Ilcoin Core developers # All Rights Reserved. ILCoin Blockchain Project 2019© from __future__ import division,print_function,unicode_literals import os import bctest import buildenv import argparse import logging help_text="""Test framework for il...
32.177778
83
0.698895
from __future__ import division,print_function,unicode_literals import os import bctest import buildenv import argparse import logging help_text="""Test framework for ilcoin utils. Runs automatically during `make check`. Can also be run manually from the src directory by specifying the source directory: test/il...
true
true
f740be8e6fb21ebb8055bd873a2d43dca9a2b898
1,402
py
Python
dbcreate.py
Volatar/ThuearleBot
f5ce0fbb1b3e2e71e062f0eb4d1276339cf6748c
[ "MIT" ]
null
null
null
dbcreate.py
Volatar/ThuearleBot
f5ce0fbb1b3e2e71e062f0eb4d1276339cf6748c
[ "MIT" ]
null
null
null
dbcreate.py
Volatar/ThuearleBot
f5ce0fbb1b3e2e71e062f0eb4d1276339cf6748c
[ "MIT" ]
null
null
null
import sqlite3 from dbconn import dbconnect import codecs db_conn = dbconnect('database/commandsDB.db') # add here when adding commands commands = ["tableflip", "gitgud", "heresy"] commands_create_sql = [] for command in commands: commands_create_sql.append(f""" CREATE TABLE IF NOT EXISTS {command} ( ...
28.612245
110
0.599144
import sqlite3 from dbconn import dbconnect import codecs db_conn = dbconnect('database/commandsDB.db') commands = ["tableflip", "gitgud", "heresy"] commands_create_sql = [] for command in commands: commands_create_sql.append(f""" CREATE TABLE IF NOT EXISTS {command} ( id integer...
true
true
f740bee981a49e7ecdc96d6f958103c901bd7ed6
5,956
py
Python
nearest_neighbert/evaluate.py
Poezedoez/NearestNeighBERT-Faiss
802c9528105295abe28be8624c7582a3c0f68835
[ "MIT" ]
null
null
null
nearest_neighbert/evaluate.py
Poezedoez/NearestNeighBERT-Faiss
802c9528105295abe28be8624c7582a3c0f68835
[ "MIT" ]
4
2020-11-13T18:47:27.000Z
2021-08-25T16:03:17.000Z
nearest_neighbert/evaluate.py
Poezedoez/NearestNeighBERT-Faiss
802c9528105295abe28be8624c7582a3c0f68835
[ "MIT" ]
null
null
null
from sklearn.metrics import precision_recall_fscore_support as prfs import numpy as np import json import argparse from typing import List, Tuple, Dict import sys # From spert.evaluator class # https://github.com/markus-eberts/spert/blob/master/spert/evaluator.py def _get_row(data, label): row = [label] for i...
34.229885
110
0.635158
from sklearn.metrics import precision_recall_fscore_support as prfs import numpy as np import json import argparse from typing import List, Tuple, Dict import sys def _get_row(data, label): row = [label] for i in range(len(data) - 1): row.append("%.2f" % (data[i] * 100)) row.append(data[3]) ...
true
true
f740c0512cf95ab5fb10a27843263bf6216389f4
3,190
py
Python
tests/data_generation/animate_berlin_x_offset.py
Algomorph/NeuralTracking
6312be8e18828344c65e25a423c239efcd3428dd
[ "Apache-2.0" ]
3
2021-04-18T04:23:08.000Z
2022-02-01T08:37:51.000Z
tests/data_generation/animate_berlin_x_offset.py
Algomorph/NeuralTracking
6312be8e18828344c65e25a423c239efcd3428dd
[ "Apache-2.0" ]
24
2021-05-28T21:59:11.000Z
2022-02-03T16:09:41.000Z
tests/data_generation/animate_berlin_x_offset.py
Algomorph/NeuralTracking
6312be8e18828344c65e25a423c239efcd3428dd
[ "Apache-2.0" ]
5
2021-03-10T02:56:16.000Z
2021-12-14T06:04:50.000Z
import sys import os import shutil import cv2 import open3d as o3d import open3d.core as o3c import numpy as np from rendering.pytorch3d_renderer import PyTorch3DRenderer from data import StandaloneFrameDataset import data.presets as presets import tsdf.default_voxel_grid import data.camera from settings import proce...
43.69863
138
0.753918
import sys import os import shutil import cv2 import open3d as o3d import open3d.core as o3c import numpy as np from rendering.pytorch3d_renderer import PyTorch3DRenderer from data import StandaloneFrameDataset import data.presets as presets import tsdf.default_voxel_grid import data.camera from settings import proce...
true
true
f740c0691f6f9fe3cd9dcdaae65c9bd929269029
1,069
py
Python
data/mRNA_233x_data/reformat_kazuki2.py
eternagame/KaggleOpenVaccine
de252988b92dc2c673a80347deb8827a12aa2ad8
[ "MIT" ]
15
2021-09-23T21:22:57.000Z
2022-03-29T06:29:44.000Z
data/mRNA_233x_data/reformat_kazuki2.py
eternagame/KaggleOpenVaccine
de252988b92dc2c673a80347deb8827a12aa2ad8
[ "MIT" ]
null
null
null
data/mRNA_233x_data/reformat_kazuki2.py
eternagame/KaggleOpenVaccine
de252988b92dc2c673a80347deb8827a12aa2ad8
[ "MIT" ]
1
2021-09-30T17:03:20.000Z
2021-09-30T17:03:20.000Z
import numpy as np import pandas as pd import gzip input_file = 'predictions/2nd-place-233-seq.csv' nickname='kazuki2' df = pd.read_csv('../233x_sequences_degdata_081120.csv') df1 = pd.read_csv(input_file) df1['ID'] = [int(x.split('_')[0]) for x in df1['id_seqpos']] df1['seqpos'] = [int(x.split('_')[1]) for x in df1...
34.483871
116
0.655753
import numpy as np import pandas as pd import gzip input_file = 'predictions/2nd-place-233-seq.csv' nickname='kazuki2' df = pd.read_csv('../233x_sequences_degdata_081120.csv') df1 = pd.read_csv(input_file) df1['ID'] = [int(x.split('_')[0]) for x in df1['id_seqpos']] df1['seqpos'] = [int(x.split('_')[1]) for x in df1...
true
true
f740c129c791da0ebf83ccc9b742e7bb907e0d85
1,655
py
Python
dpx/hosting/tasks.py
DotPodcast/dotpodcast-dpx
5a084a07d094180eaefbb0946d274f74c1472e02
[ "MIT" ]
8
2018-06-10T20:41:50.000Z
2021-03-05T16:33:11.000Z
dpx/hosting/tasks.py
DotPodcast/dotpodcast-dpx
5a084a07d094180eaefbb0946d274f74c1472e02
[ "MIT" ]
8
2021-03-18T20:20:20.000Z
2022-03-11T23:15:30.000Z
dpx/hosting/tasks.py
DotPodcast/dotpodcast-dpx
5a084a07d094180eaefbb0946d274f74c1472e02
[ "MIT" ]
null
null
null
from django.db import transaction from mutagen.mp3 import MP3 from os import path @transaction.atomic() def fetch_feed(podcast_pk, url): from ..validator.utils import find_validator from .models import Podcast import requests import json response = requests.get(url, stream=True) response.rais...
25.859375
71
0.73716
from django.db import transaction from mutagen.mp3 import MP3 from os import path @transaction.atomic() def fetch_feed(podcast_pk, url): from ..validator.utils import find_validator from .models import Podcast import requests import json response = requests.get(url, stream=True) response.rais...
true
true
f740c1c6394c0ec3792c0f9afcc9707a54e5e9b9
10,476
py
Python
grasso/fat.py
joakimfors/grasso
a31ed8d83739ed5e90e648c3e572d425149e6ee8
[ "MIT" ]
5
2016-10-27T23:56:53.000Z
2021-06-11T21:05:27.000Z
grasso/fat.py
joakimfors/grasso
a31ed8d83739ed5e90e648c3e572d425149e6ee8
[ "MIT" ]
1
2018-01-13T16:09:17.000Z
2018-01-13T16:09:17.000Z
grasso/fat.py
joakimfors/grasso
a31ed8d83739ed5e90e648c3e572d425149e6ee8
[ "MIT" ]
2
2016-04-11T17:14:14.000Z
2020-04-18T12:00:50.000Z
# -*- encoding: utf-8 -*- # # Grasso - a FAT filesystem parser # # Copyright 2011 Emanuele Aina <em@nerd.ocracy.org> # # Released under the term of a MIT-style license, see LICENSE # for details. import math, io, pprint from struct import unpack from .util import FragmentInfo, FragmentedIO class BootSector(object): ...
32.433437
98
0.540378
import math, io, pprint from struct import unpack from .util import FragmentInfo, FragmentedIO class BootSector(object): length = 36 unpacker = "<3s8sHBHBHHBHHHLL" def __init__(self, filesystem): self.filesystem = filesystem self.offset = self.filesystem.source.tell() data ...
true
true
f740c29e198f1d91e8d6d588111cb2cfa97cdbb6
136
py
Python
train.py
bendemers/Halite3-SVM-Bot
ae30b821d760bd6f7e15f6094029ab78ceaa88d6
[ "MIT" ]
null
null
null
train.py
bendemers/Halite3-SVM-Bot
ae30b821d760bd6f7e15f6094029ab78ceaa88d6
[ "MIT" ]
null
null
null
train.py
bendemers/Halite3-SVM-Bot
ae30b821d760bd6f7e15f6094029ab78ceaa88d6
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import model m = model.HaliteModel() m.train_on_files('training', 'aggressive') m.save(file_name='greedy.svc')
17
42
0.735294
import model m = model.HaliteModel() m.train_on_files('training', 'aggressive') m.save(file_name='greedy.svc')
true
true
f740c366a98f6fce9f49da2c1d02cb2feedd91e6
3,512
py
Python
core/cube_sim.py
SrivenkatAnr/rcube-3x3
028f2ed7f2e17b07e5d44ce7e68c52e8bb692ad5
[ "Apache-2.0" ]
null
null
null
core/cube_sim.py
SrivenkatAnr/rcube-3x3
028f2ed7f2e17b07e5d44ce7e68c52e8bb692ad5
[ "Apache-2.0" ]
null
null
null
core/cube_sim.py
SrivenkatAnr/rcube-3x3
028f2ed7f2e17b07e5d44ce7e68c52e8bb692ad5
[ "Apache-2.0" ]
null
null
null
from .legacy_cube import CubeClass class Cube(CubeClass): def __init__(self,faces): super().__init__(faces) self.algo = [] self.rotation_dict = {'r':lambda x:x.R(),\ 'l':lambda x:x.L(),\ 'u':lambda x:x.U(),\ 'f':lambda x:x.F(),\ 'b':lambda x:x.B(),\ 'd':lambda x:x.D(...
22.805195
71
0.557802
from .legacy_cube import CubeClass class Cube(CubeClass): def __init__(self,faces): super().__init__(faces) self.algo = [] self.rotation_dict = {'r':lambda x:x.R(),\ 'l':lambda x:x.L(),\ 'u':lambda x:x.U(),\ 'f':lambda x:x.F(),\ 'b':lambda x:x.B(),\ 'd':lambda x:x.D(...
true
true
f740c468e7f6575b7080d0ba4618b4b551871348
4,841
py
Python
Lib/distutils/command/bdist_dumb.py
yht/python-2.6
adafa70c0ebe675e09d81ba17f38b463603f85f3
[ "PSF-2.0" ]
1
2016-04-09T02:58:13.000Z
2016-04-09T02:58:13.000Z
cygwin/lib/python2.6/distutils/command/bdist_dumb.py
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
cygwin/lib/python2.6/distutils/command/bdist_dumb.py
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
1
2021-02-23T21:57:26.000Z
2021-02-23T21:57:26.000Z
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id$" import os from distutils.core import Command fro...
35.595588
77
0.552159
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" __revision__ = "$Id$" import os from distutils.core import Command from distutils.util import get_platform from distutils.dir_...
false
true
f740c474e8a02fdebdc385aa330790e7549e6c27
412
py
Python
myproject/wsgi.py
bpomerenke/heroku_django_poc
68569436c0d335dd7afe22c82eba44be12f7697f
[ "MIT" ]
null
null
null
myproject/wsgi.py
bpomerenke/heroku_django_poc
68569436c0d335dd7afe22c82eba44be12f7697f
[ "MIT" ]
7
2019-10-22T14:15:59.000Z
2022-02-10T08:50:49.000Z
myproject/wsgi.py
sureshkunku/Dispatch
eda68d5bf94029a324d22f5b6eb6c5087923ab7e
[ "MIT" ]
null
null
null
""" WSGI config for myproject project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefau...
24.235294
79
0.757282
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings") application = get_wsgi_application()
true
true
f740c4a51217a57212ae7263da233a134de620cc
5,926
py
Python
python/opscore/RO/Wdg/CmdWdg.py
sdss/opscore
dd4f2b2ad525fe3dfe3565463de2c079a7e1232e
[ "BSD-3-Clause" ]
null
null
null
python/opscore/RO/Wdg/CmdWdg.py
sdss/opscore
dd4f2b2ad525fe3dfe3565463de2c079a7e1232e
[ "BSD-3-Clause" ]
1
2021-08-17T21:08:14.000Z
2021-08-17T21:08:14.000Z
python/opscore/RO/Wdg/CmdWdg.py
sdss/opscore
dd4f2b2ad525fe3dfe3565463de2c079a7e1232e
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python """Entry widget for commands, with history. History: 2002-11-13 ROwen Added history. Bug fix: entering a command would not scroll all the way to the bottom if data was coming in; fixed using a carefully placed update_idletasks (we'll see if this always ...
36.134146
97
0.614242
__all__ = ['CmdWdg'] from six.moves import tkinter from . import Entry class CmdWdg (Entry.StrEntry): def __init__ (self, master, cmdFunc, maxCmds=50, helpURL = None, **kargs): Entry.StrEntry.__init__(self, master = master, helpURL = helpURL, ...
true
true
f740c585a03d014410fc920058bd8a773848dd26
458
py
Python
permute/Solution.py
lordlamb/leetcode
ac270ab6301bcd712b655bca4d6f1ce1e066bce2
[ "MIT" ]
null
null
null
permute/Solution.py
lordlamb/leetcode
ac270ab6301bcd712b655bca4d6f1ce1e066bce2
[ "MIT" ]
null
null
null
permute/Solution.py
lordlamb/leetcode
ac270ab6301bcd712b655bca4d6f1ce1e066bce2
[ "MIT" ]
null
null
null
""" 给定一个没有重复数字的序列,返回其所有可能的全排列。 """ from typing import List class Solution: def permute(self, nums: List[int]) -> List[List[int]]: if len(nums) == 1: return [nums] else: ret = [] for i in range(len(nums)): sub_permute = self.permute(nums[0:i] + n...
20.818182
77
0.49345
from typing import List class Solution: def permute(self, nums: List[int]) -> List[List[int]]: if len(nums) == 1: return [nums] else: ret = [] for i in range(len(nums)): sub_permute = self.permute(nums[0:i] + nums[i + 1:len(nums)]) ...
true
true
f740c641c8ce16f61b85aa2d13c4c3910ac781c7
4,412
py
Python
dragDropInstall.py
lukasstudio/depthOfFieldTool
03fedb4453a1e8498362c4732ce2b953db1cd718
[ "MIT" ]
2
2022-02-09T13:59:50.000Z
2022-03-08T16:40:45.000Z
dragDropInstall.py
lukasstudio/depthOfFieldTool
03fedb4453a1e8498362c4732ce2b953db1cd718
[ "MIT" ]
null
null
null
dragDropInstall.py
lukasstudio/depthOfFieldTool
03fedb4453a1e8498362c4732ce2b953db1cd718
[ "MIT" ]
null
null
null
"""Requires Python 3""" # General imports import os, sys, shutil # Third-Party imports from PySide2 import QtCore import maya.cmds as cmds from maya.app.startup import basic import maya.utils # Base path definitions MODULENAME = "depthOfFieldTool" DRAGGEDFROMPATH = os.path.dirname(__file__) DEFAULTMODULEPATH = f"...
31.514286
89
0.758386
import os, sys, shutil from PySide2 import QtCore import maya.cmds as cmds from maya.app.startup import basic import maya.utils MODULENAME = "depthOfFieldTool" DRAGGEDFROMPATH = os.path.dirname(__file__) DEFAULTMODULEPATH = f"{os.environ['MAYA_APP_DIR']}/modules" DEFAULTSCRIPTSPATH = f"{os.environ['MAYA_APP_DIR...
true
true
f740c6a07c8be7341061360434fe1031f96d942f
1,436
py
Python
libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_request_body.py
Fl4v/botbuilder-python
4003d713beb8fb986a01cfd11632eabc65858618
[ "MIT" ]
388
2019-05-07T15:53:21.000Z
2022-03-28T20:29:46.000Z
libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_request_body.py
Fl4v/botbuilder-python
4003d713beb8fb986a01cfd11632eabc65858618
[ "MIT" ]
1,286
2019-05-07T23:38:19.000Z
2022-03-31T10:44:16.000Z
libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_request_body.py
Fl4v/botbuilder-python
4003d713beb8fb986a01cfd11632eabc65858618
[ "MIT" ]
168
2019-05-14T20:23:25.000Z
2022-03-16T06:49:14.000Z
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from typing import List from botbuilder.adapters.slack.slack_event import SlackEvent from botbuilder.adapters.slack.slack_payload import SlackPayload class SlackRequestBody: def __init__(self, **kwargs): ...
37.789474
89
0.617688
from typing import List from botbuilder.adapters.slack.slack_event import SlackEvent from botbuilder.adapters.slack.slack_payload import SlackPayload class SlackRequestBody: def __init__(self, **kwargs): self.challenge = kwargs.get("challenge") self.token = kwargs.get("token") ...
true
true
f740c6a94c533f90a4e1f1b35218f797f5806171
2,918
py
Python
ViolentFlowFeature/ViolentFlow/violent.py
sekharkaredla/ASAGS
142173fc23bd42dcfdf74cf3850db445864f906a
[ "MIT" ]
10
2018-08-02T09:31:19.000Z
2022-01-27T19:46:30.000Z
ViolentFlowFeature/ViolentFlow/violent.py
sekharkaredla/Project
142173fc23bd42dcfdf74cf3850db445864f906a
[ "MIT" ]
3
2019-02-08T17:49:54.000Z
2019-10-31T14:11:58.000Z
ViolentFlowFeature/ViolentFlow/violent.py
sekharkaredla/Project
142173fc23bd42dcfdf74cf3850db445864f906a
[ "MIT" ]
12
2018-04-08T07:48:59.000Z
2021-12-10T16:44:22.000Z
import cv2 import numpy as np from VideoProcess import PreProcess from OpticalFlow import OptFlow import math class VioFlow: def __init__(self,video_name): self.height = 0 self.width = 0 self.B_height = 0 self.B_width = 0 self.bins = np.arange(0.0,1.05,0.05,dtype=np.float64)...
35.156627
94
0.632282
import cv2 import numpy as np from VideoProcess import PreProcess from OpticalFlow import OptFlow import math class VioFlow: def __init__(self,video_name): self.height = 0 self.width = 0 self.B_height = 0 self.B_width = 0 self.bins = np.arange(0.0,1.05,0.05,dtype=np.float64)...
false
true
f740c6abeb60174e186fd70c792ca53c83648c0c
7,669
py
Python
nets/SBMs_node_classification/mo_net.py
karl-zhao/benchmarking-gnns-pyg
23d2c823f16ead554b22ff31c41d5bd8074b133e
[ "MIT" ]
17
2020-12-03T12:20:04.000Z
2021-09-15T05:43:03.000Z
nets/SBMs_node_classification/mo_net.py
karl-zhao/benchmarking-gnns-pyg
23d2c823f16ead554b22ff31c41d5bd8074b133e
[ "MIT" ]
null
null
null
nets/SBMs_node_classification/mo_net.py
karl-zhao/benchmarking-gnns-pyg
23d2c823f16ead554b22ff31c41d5bd8074b133e
[ "MIT" ]
null
null
null
import torch import torch.nn as nn import torch.nn.functional as F # from torch_scatter import scatter_add # from num_nodes import maybe_num_nodes import dgl from torch_geometric.nn.conv import MessagePassing import numpy as np import torch.nn as nn from torch import Tensor # from torch_geometric.utils import degree fr...
41.231183
121
0.610771
import torch import torch.nn as nn import torch.nn.functional as F import dgl from torch_geometric.nn.conv import MessagePassing import numpy as np import torch.nn as nn from torch import Tensor from torch_scatter import scatter_add from layers.gmm_layer import GMMLayer from layers.mlp_readout_layer import MLPRead...
true
true
f740c7dd1c89fc46a95212930b4a92fec6fc2f0c
2,846
py
Python
Camera_Intrinsic_Calibration_Opencv_Python/calibrate_2_4_x.py
ChiFang/Camera_calibration
a490df5ed16051f52257e4b5636883bc4974de64
[ "MIT" ]
null
null
null
Camera_Intrinsic_Calibration_Opencv_Python/calibrate_2_4_x.py
ChiFang/Camera_calibration
a490df5ed16051f52257e4b5636883bc4974de64
[ "MIT" ]
null
null
null
Camera_Intrinsic_Calibration_Opencv_Python/calibrate_2_4_x.py
ChiFang/Camera_calibration
a490df5ed16051f52257e4b5636883bc4974de64
[ "MIT" ]
null
null
null
#!/usr/bin/env python import numpy as np import cv2 import os from common import splitfn USAGE = ''' USAGE: calib.py [--save <filename>] [--debug <output path>] [--square_size] [<image mask>] ''' if __name__ == '__main__': import sys, getopt from glob import glob args, img_mask = getopt.getopt(sys.arg...
31.977528
102
0.589599
import numpy as np import cv2 import os from common import splitfn USAGE = ''' USAGE: calib.py [--save <filename>] [--debug <output path>] [--square_size] [<image mask>] ''' if __name__ == '__main__': import sys, getopt from glob import glob args, img_mask = getopt.getopt(sys.argv[1:], '', ['save=', ...
false
true
f740c7e4c84cf2fefa798fe9aeebca8956782624
3,641
py
Python
tensorflow_federated/python/core/impl/execution_contexts/async_execution_context_test.py
teo-milea/federated
ce0707a954a531860eb38864b44d7b748fd62aa7
[ "Apache-2.0" ]
null
null
null
tensorflow_federated/python/core/impl/execution_contexts/async_execution_context_test.py
teo-milea/federated
ce0707a954a531860eb38864b44d7b748fd62aa7
[ "Apache-2.0" ]
null
null
null
tensorflow_federated/python/core/impl/execution_contexts/async_execution_context_test.py
teo-milea/federated
ce0707a954a531860eb38864b44d7b748fd62aa7
[ "Apache-2.0" ]
null
null
null
# Copyright 2021, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
39.150538
92
0.773139
import asyncio import numpy as np import tensorflow as tf from tensorflow_federated.python.core.api import computations from tensorflow_federated.python.core.impl.context_stack import get_context_stack from tensorflow_federated.python.core.impl.execution_contexts import async_execution_context from tenso...
true
true
f740c8584711d37f9423372400f599abc6cf9519
6,424
py
Python
netcfgbu/config_model.py
jeremyschulman/netcfgbu
c2056f07aefa7c9e584fc9a34c9971100df7fa49
[ "Apache-2.0" ]
83
2020-06-02T13:25:33.000Z
2022-03-07T20:50:36.000Z
netcfgbu/config_model.py
jeremyschulman/netcfgbu
c2056f07aefa7c9e584fc9a34c9971100df7fa49
[ "Apache-2.0" ]
55
2020-06-03T17:51:31.000Z
2021-08-14T14:13:56.000Z
netcfgbu/config_model.py
jeremyschulman/netcfgbu
c2056f07aefa7c9e584fc9a34c9971100df7fa49
[ "Apache-2.0" ]
16
2020-06-05T20:32:27.000Z
2021-11-01T17:06:38.000Z
import re import os from typing import Optional, Union, List, Dict from os.path import expandvars from itertools import chain from pathlib import Path from pydantic import ( BaseModel, SecretStr, BaseSettings, PositiveInt, FilePath, Field, validator, root_validator, ) from . import co...
28.551111
88
0.650218
import re import os from typing import Optional, Union, List, Dict from os.path import expandvars from itertools import chain from pathlib import Path from pydantic import ( BaseModel, SecretStr, BaseSettings, PositiveInt, FilePath, Field, validator, root_validator, ) from . import co...
true
true
f740c8bf589ff3e844fb2a23581fe799de66a8ac
4,267
py
Python
openmdao/matrices/dense_matrix.py
naylor-b/blue
d7d7e8d63212c047a7a9b0625da98aa29ddc39b4
[ "Apache-2.0" ]
1
2016-05-10T17:01:17.000Z
2016-05-10T17:01:17.000Z
openmdao/matrices/dense_matrix.py
gsoxley/OpenMDAO
709401e535cf6933215abd942d4b4d49dbf61b2b
[ "Apache-2.0" ]
3
2016-05-10T16:55:46.000Z
2018-10-22T23:28:52.000Z
openmdao/matrices/dense_matrix.py
gsoxley/OpenMDAO
709401e535cf6933215abd942d4b4d49dbf61b2b
[ "Apache-2.0" ]
2
2018-04-05T15:53:54.000Z
2018-10-22T22:48:00.000Z
"""Define the DenseMatrix class.""" from __future__ import division, print_function import numpy as np from numpy import ndarray from six import iteritems from scipy.sparse import coo_matrix from openmdao.matrices.coo_matrix import COOMatrix # NOTE: DenseMatrix is inherited from COOMatrix so that we can easily handl...
32.572519
89
0.572065
from __future__ import division, print_function import numpy as np from numpy import ndarray from six import iteritems from scipy.sparse import coo_matrix from openmdao.matrices.coo_matrix import COOMatrix class DenseMatrix(COOMatrix): def _build(self, num_rows, num_cols, in_ranges, out_ranges): s...
true
true
f740c91a26d7812d713fe4bf1a9ef2d9bfcffa43
6,968
py
Python
rc/models/drqa.py
WERimagin/baseline_CoQA
d11d19283b4c9b9b15cfcdb96bf5cd262bb953e8
[ "MIT" ]
null
null
null
rc/models/drqa.py
WERimagin/baseline_CoQA
d11d19283b4c9b9b15cfcdb96bf5cd262bb953e8
[ "MIT" ]
null
null
null
rc/models/drqa.py
WERimagin/baseline_CoQA
d11d19283b4c9b9b15cfcdb96bf5cd262bb953e8
[ "MIT" ]
null
null
null
import torch import torch.nn as nn import torch.nn.functional as F from .layers import SeqAttnMatch, StackedBRNN, LinearSeqAttn, BilinearSeqAttn from .layers import weighted_avg, uniform_weights, dropout class DrQA(nn.Module): """Network for the Document Reader module of DrQA.""" _RNN_TYPES = {'lstm': nn.LSTM...
43.823899
117
0.630454
import torch import torch.nn as nn import torch.nn.functional as F from .layers import SeqAttnMatch, StackedBRNN, LinearSeqAttn, BilinearSeqAttn from .layers import weighted_avg, uniform_weights, dropout class DrQA(nn.Module): _RNN_TYPES = {'lstm': nn.LSTM, 'gru': nn.GRU, 'rnn': nn.RNN} def __init__(self, co...
true
true
f740c92f0e4de229327eb38592e11853a396d312
880
py
Python
tests/test_Signing.py
christophevg/py-mqfactory
6681fea96efe6985f6dc8631cb96eb48c43146dd
[ "MIT" ]
null
null
null
tests/test_Signing.py
christophevg/py-mqfactory
6681fea96efe6985f6dc8631cb96eb48c43146dd
[ "MIT" ]
4
2020-03-24T16:51:35.000Z
2021-06-01T23:37:00.000Z
tests/test_Signing.py
christophevg/py-mqfactory
6681fea96efe6985f6dc8631cb96eb48c43146dd
[ "MIT" ]
null
null
null
from mqfactory import Message from mqfactory.message.security import Signing, Signature from mqfactory.tools import Policy, Rule def test_signing_setup(mq, transport, signature): Signing( mq, adding=signature ) mq.before_sending.append.assert_called_with(signature.sign) mq.before_han...
31.428571
66
0.744318
from mqfactory import Message from mqfactory.message.security import Signing, Signature from mqfactory.tools import Policy, Rule def test_signing_setup(mq, transport, signature): Signing( mq, adding=signature ) mq.before_sending.append.assert_called_with(signature.sign) mq.before_han...
true
true
f740c935f94c34d5854ef8e7c113a605e9699a93
7,153
py
Python
eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3consts.py
ModelWriter/smtlib-tool
b075a8b6bf6188134a50f3884aad480d468fe558
[ "MIT" ]
null
null
null
eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3consts.py
ModelWriter/smtlib-tool
b075a8b6bf6188134a50f3884aad480d468fe558
[ "MIT" ]
null
null
null
eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3consts.py
ModelWriter/smtlib-tool
b075a8b6bf6188134a50f3884aad480d468fe558
[ "MIT" ]
null
null
null
# Automatically generated file # enum Z3_lbool Z3_L_FALSE = -1 Z3_L_UNDEF = 0 Z3_L_TRUE = 1 # enum Z3_symbol_kind Z3_INT_SYMBOL = 0 Z3_STRING_SYMBOL = 1 # enum Z3_parameter_kind Z3_PARAMETER_INT = 0 Z3_PARAMETER_DOUBLE = 1 Z3_PARAMETER_RATIONAL = 2 Z3_PARAMETER_SYMBOL = 3 Z3_PARAMETER_SORT = 4 Z3_PA...
22.214286
41
0.779952
Z3_L_FALSE = -1 Z3_L_UNDEF = 0 Z3_L_TRUE = 1 Z3_INT_SYMBOL = 0 Z3_STRING_SYMBOL = 1 Z3_PARAMETER_INT = 0 Z3_PARAMETER_DOUBLE = 1 Z3_PARAMETER_RATIONAL = 2 Z3_PARAMETER_SYMBOL = 3 Z3_PARAMETER_SORT = 4 Z3_PARAMETER_AST = 5 Z3_PARAMETER_FUNC_DECL = 6 Z3_UNINTERPRETED_SORT = 0 Z3_BOOL_SORT = 1 Z...
true
true
f740c9986dc746cfac8baa40badc2ab15f62282e
3,803
py
Python
875-domain.py
wpliao19/test
c6af60b3a7112fc54994e8fb550e2d54fbdc48ab
[ "Apache-2.0" ]
null
null
null
875-domain.py
wpliao19/test
c6af60b3a7112fc54994e8fb550e2d54fbdc48ab
[ "Apache-2.0" ]
1
2022-01-17T03:05:33.000Z
2022-01-17T03:05:53.000Z
875-domain.py
wpliao19/test
c6af60b3a7112fc54994e8fb550e2d54fbdc48ab
[ "Apache-2.0" ]
null
null
null
#!/bin/python3 # -*- coding:utf-8 -*- # CTX Engine-874 : IP # 1、查询ip样本 2、查看查询结�?# 2、返回正确的ioc信息 from maldium import * import ctypes def print_result(result, extra_res): if result is None: print("query failed") return if result.eMatchType == engine.NO_MATCH: print("result NO_MATCH") ...
34.889908
400
0.677097
import * import ctypes def print_result(result, extra_res): if result is None: print("query failed") return if result.eMatchType == engine.NO_MATCH: print("result NO_MATCH") return elif result.eMatchType == engine.LOCAL_PTN_MATCHED: match_type = "LOCAL_PTN_MATC...
true
true
f740cb07c4339f7ad2f9b477c54d3426f808f79d
33,661
py
Python
src/saml2/client_base.py
openstack/deb-python-pysaml2
c54db131dd2c54b18bdc300ba7fdf3b08e68f07c
[ "Apache-2.0" ]
13
2016-09-14T21:59:45.000Z
2019-04-01T12:16:19.000Z
src/saml2/client_base.py
openstack/deb-python-pysaml2
c54db131dd2c54b18bdc300ba7fdf3b08e68f07c
[ "Apache-2.0" ]
null
null
null
src/saml2/client_base.py
openstack/deb-python-pysaml2
c54db131dd2c54b18bdc300ba7fdf3b08e68f07c
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # """Contains classes and functions that a SAML2.0 Service Provider (SP) may use to conclude its tasks. """ import threading import six from saml2.entity import Entity from saml2.mdstore import destinations from saml2.profile import paos, ecp from saml2.saml import NAMEI...
39.140698
89
0.569116
import threading import six from saml2.entity import Entity from saml2.mdstore import destinations from saml2.profile import paos, ecp from saml2.saml import NAMEID_FORMAT_TRANSIENT from saml2.samlp import AuthnQuery, RequestedAuthnContext from saml2.samlp import NameIDMappingRequest from saml2.samlp import Attri...
true
true
f740cbe94b9e66e8318cfcdb61f496681bcfc403
188
py
Python
Exercices/Secao04/exercicio18.py
Guilt-tech/PythonExercices
e59bffae997a1974d3e3cdcfff7700afbed65e6e
[ "MIT" ]
null
null
null
Exercices/Secao04/exercicio18.py
Guilt-tech/PythonExercices
e59bffae997a1974d3e3cdcfff7700afbed65e6e
[ "MIT" ]
null
null
null
Exercices/Secao04/exercicio18.py
Guilt-tech/PythonExercices
e59bffae997a1974d3e3cdcfff7700afbed65e6e
[ "MIT" ]
null
null
null
print('Digite um valor de volume em metros cúbocos, que será convertido em libras') M = float(input('Volume: ')) L = 1000 * M print(f'O volume em litros é: {L} e em metros cúbicos é: {M}')
47
83
0.691489
print('Digite um valor de volume em metros cúbocos, que será convertido em libras') M = float(input('Volume: ')) L = 1000 * M print(f'O volume em litros é: {L} e em metros cúbicos é: {M}')
true
true
f740cc8ccc902f8792988edc6cdc36fe9d1d126e
6,305
py
Python
homeassistant/components/ifttt/alarm_control_panel.py
fuzzie360/home-assistant
8933540950cb755b041535bd628710abb122dde5
[ "Apache-2.0" ]
1
2020-06-04T13:18:14.000Z
2020-06-04T13:18:14.000Z
homeassistant/components/ifttt/alarm_control_panel.py
fuzzie360/home-assistant
8933540950cb755b041535bd628710abb122dde5
[ "Apache-2.0" ]
null
null
null
homeassistant/components/ifttt/alarm_control_panel.py
fuzzie360/home-assistant
8933540950cb755b041535bd628710abb122dde5
[ "Apache-2.0" ]
null
null
null
"""Support for alarm control panels that can be controlled through IFTTT.""" import logging import re import voluptuous as vol import homeassistant.components.alarm_control_panel as alarm from homeassistant.components.alarm_control_panel import DOMAIN, PLATFORM_SCHEMA from homeassistant.components.alarm_control_panel...
32.333333
88
0.69548
import logging import re import voluptuous as vol import homeassistant.components.alarm_control_panel as alarm from homeassistant.components.alarm_control_panel import DOMAIN, PLATFORM_SCHEMA from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_HOME, S...
true
true
f740cc9a82a23b8159257b8e2ab2019fc8c0b9f6
2,686
py
Python
src/multidirmap/_read_only_dict.py
janrg/multidirmap
d056607f1e5aeb59ba8447361315748dca80c4f0
[ "MIT" ]
3
2019-10-11T14:16:59.000Z
2019-10-16T15:40:48.000Z
src/multidirmap/_read_only_dict.py
janrg/multidirmap
d056607f1e5aeb59ba8447361315748dca80c4f0
[ "MIT" ]
5
2018-07-28T16:20:50.000Z
2019-09-27T13:47:50.000Z
src/multidirmap/_read_only_dict.py
janrg/multidirmap
d056607f1e5aeb59ba8447361315748dca80c4f0
[ "MIT" ]
1
2021-05-20T14:35:49.000Z
2021-05-20T14:35:49.000Z
"""Thin wrapper for dict or OrderedDict providing togglable read-only. If the Python version keeps dict entries in insertion order, dict is used, otherwise OrderedDict. """ import sys if ( sys.version_info[:3] >= (3, 6, 0) # pragma: no cover and sys.implementation.name == "cpython" ) or sys.version_info >= ...
30.179775
80
0.655249
import sys if ( sys.version_info[:3] >= (3, 6, 0) and sys.implementation.name == "cpython" ) or sys.version_info >= (3, 7, 0): _dicttype = dict else: from collections import OrderedDict _dicttype = OrderedDict def if_not_read_only(f): def wrapper(*args): if args[0]._read_only: ...
true
true
f740cd677e2937b8b6318a119f8a2a2e2f080a2e
9,689
py
Python
tests/wallet/sync/test_wallet_sync.py
grayfallstown/scam-blockchain
2183020cc74bbd1a63dda6eb0d0e73c2a3429594
[ "Apache-2.0" ]
12
2021-08-04T14:35:02.000Z
2022-02-09T04:31:44.000Z
tests/wallet/sync/test_wallet_sync.py
grayfallstown/scam-blockchain
2183020cc74bbd1a63dda6eb0d0e73c2a3429594
[ "Apache-2.0" ]
8
2021-08-04T20:58:10.000Z
2021-09-11T17:08:28.000Z
tests/wallet/sync/test_wallet_sync.py
grayfallstown/scam-blockchain
2183020cc74bbd1a63dda6eb0d0e73c2a3429594
[ "Apache-2.0" ]
4
2021-07-28T09:50:55.000Z
2022-03-15T08:43:53.000Z
# flake8: noqa: F811, F401 import asyncio import pytest from colorlog import logging from scam.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward from scam.protocols import full_node_protocol from scam.simulator.simulator_protocol import FarmNewBlockProtocol from scam.types.peer_info i...
41.583691
118
0.727732
import asyncio import pytest from colorlog import logging from scam.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward from scam.protocols import full_node_protocol from scam.simulator.simulator_protocol import FarmNewBlockProtocol from scam.types.peer_info import PeerInfo from scam.u...
true
true
f740cd70e22bf0c86f278bb82af8369e7dd267cd
1,858
py
Python
test/test_exceptions.py
dhrone/pyASH
85da060d135fb8be6475d58d4dc33acf88a3a9b2
[ "MIT" ]
null
null
null
test/test_exceptions.py
dhrone/pyASH
85da060d135fb8be6475d58d4dc33acf88a3a9b2
[ "MIT" ]
null
null
null
test/test_exceptions.py
dhrone/pyASH
85da060d135fb8be6475d58d4dc33acf88a3a9b2
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright 2018 by dhrone. All Rights Reserved. # import pytest import json from python_jsonschema_objects import ValidationError from pyASH.exceptions import * from pyASH.pyASH import pyASH from pyASH.objects import Request # Imports for v3 validation import jsonschema from jsonschema im...
25.452055
87
0.603875
import pytest import json from python_jsonschema_objects import ValidationError from pyASH.exceptions import * from pyASH.pyASH import pyASH from pyASH.objects import Request import jsonschema from jsonschema import validate import json from pyASH.validation import validate_message @pytest.fixture def setup(...
true
true
f740cd7d1496c9f5a0447132a9ab1437e71c1ee8
4,722
py
Python
appengine/components/components/auth/prpc.py
maruel/swarming
8ab7568635fcbfd85a01884b64704fc2a1ac13c7
[ "Apache-2.0" ]
74
2015-04-01T02:35:15.000Z
2021-12-17T22:10:56.000Z
appengine/components/components/auth/prpc.py
maruel/swarming
8ab7568635fcbfd85a01884b64704fc2a1ac13c7
[ "Apache-2.0" ]
123
2015-04-01T04:02:57.000Z
2022-03-02T12:49:55.000Z
appengine/components/components/auth/prpc.py
maruel/swarming
8ab7568635fcbfd85a01884b64704fc2a1ac13c7
[ "Apache-2.0" ]
32
2015-04-03T01:40:47.000Z
2021-11-13T15:20:13.000Z
# Copyright 2018 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Defines pRPC server interceptor that initializes auth context.""" import logging from components import prpc from . import api from . import...
33.020979
77
0.739094
import logging from components import prpc from . import api from . import check from . import config from . import delegation from . import ipaddr from . import model __all__ = ['prpc_interceptor'] def prpc_interceptor(request, context, call_details, continuation): try: peer_ip = _parse_rpc_peer(cont...
true
true
f740ce1d40723cea3cf57212153bb9152264283d
6,070
py
Python
heat/engine/resources/openstack/ceilometer/gnocchi/alarm.py
whitepages/heat
4da2e1262fa42e6107389ba7a0e72ade024e316f
[ "Apache-2.0" ]
null
null
null
heat/engine/resources/openstack/ceilometer/gnocchi/alarm.py
whitepages/heat
4da2e1262fa42e6107389ba7a0e72ade024e316f
[ "Apache-2.0" ]
null
null
null
heat/engine/resources/openstack/ceilometer/gnocchi/alarm.py
whitepages/heat
4da2e1262fa42e6107389ba7a0e72ade024e316f
[ "Apache-2.0" ]
1
2021-03-21T11:37:03.000Z
2021-03-21T11:37:03.000Z
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
31.614583
79
0.658155
from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine.resources.openstack.ceilometer import alarm from heat.engine import support COMMON_GNOCCHI_PROPERTIES = ( COMPARISON_OPERATOR, EVALUATION_PERIODS, GRANULARITY, AGGREGATION_METHO...
true
true
f740ce378e2f71daeee1212a841c70ec2a37a4a4
800
py
Python
python/SqlParser/config_create.py
DataHandwerk/DataHandwerk-toolkit-mssql
0225d7f3a6c12041c81c932cc97c8dee40c9c658
[ "MIT" ]
1
2021-01-14T07:13:39.000Z
2021-01-14T07:13:39.000Z
python/SqlParser/config_create.py
DataHandwerk/DataHandwerk-toolkit-mssql
0225d7f3a6c12041c81c932cc97c8dee40c9c658
[ "MIT" ]
null
null
null
python/SqlParser/config_create.py
DataHandwerk/DataHandwerk-toolkit-mssql
0225d7f3a6c12041c81c932cc97c8dee40c9c658
[ "MIT" ]
null
null
null
#execute #py config_create.py import configparser config = configparser.ConfigParser() config['mssql'] = {} config['mssql']['server'] = 'localhost\sql2019' config['mssql']['database'] = 'dhw_PerformanceAnalytics' # mssql = config['mssql'] # mssql['server'] = 'localhost\sql2019' # config['DEFAULT'] = {'ServerAliveIn...
30.769231
56
0.63625
import configparser config = configparser.ConfigParser() config['mssql'] = {} config['mssql']['server'] = 'localhost\sql2019' config['mssql']['database'] = 'dhw_PerformanceAnalytics' 'w') as configfile: config.write(configfile)
true
true
f740ce69f54e0e79275c16eed57d65a3603fe695
1,023
py
Python
examples/volumetric/slicePlane1.py
charliekind/vtkplotter
e16daac258dc0b383043575f2916ac4ea84a60b1
[ "MIT" ]
null
null
null
examples/volumetric/slicePlane1.py
charliekind/vtkplotter
e16daac258dc0b383043575f2916ac4ea84a60b1
[ "MIT" ]
null
null
null
examples/volumetric/slicePlane1.py
charliekind/vtkplotter
e16daac258dc0b383043575f2916ac4ea84a60b1
[ "MIT" ]
null
null
null
"""Slice a Volume with an arbitrary plane hover the plane to get the scalar values""" from vedo import * vol = Volume(dataurl+'embryo.slc').alpha([0,0,0.8]).c('w').pickable(False) sl = vol.slicePlane(origin=vol.center(), normal=(0,1,1)) sl.cmap('Purples_r').lighting('off').addScalarBar(title='Slice', c='w') arr = sl....
42.625
77
0.679374
from vedo import * vol = Volume(dataurl+'embryo.slc').alpha([0,0,0.8]).c('w').pickable(False) sl = vol.slicePlane(origin=vol.center(), normal=(0,1,1)) sl.cmap('Purples_r').lighting('off').addScalarBar(title='Slice', c='w') arr = sl.pointdata[0] def func(evt): if not evt.actor: return pid = evt.actor...
true
true
f740cef1c3f314ddaf4f469899de7f596a8048b7
152
py
Python
django_chat/chat/admin.py
ugauniyal/Real-Time-Chat
1c5f44f0cd53a5c65cbf3c9cd8c5af0f9b96475a
[ "MIT" ]
null
null
null
django_chat/chat/admin.py
ugauniyal/Real-Time-Chat
1c5f44f0cd53a5c65cbf3c9cd8c5af0f9b96475a
[ "MIT" ]
null
null
null
django_chat/chat/admin.py
ugauniyal/Real-Time-Chat
1c5f44f0cd53a5c65cbf3c9cd8c5af0f9b96475a
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Room, Message # Register your models here. admin.site.register(Room) admin.site.register(Message)
21.714286
33
0.802632
from django.contrib import admin from .models import Room, Message admin.site.register(Room) admin.site.register(Message)
true
true
f740cf4557b3025e6483dbb0e6153220c2507168
3,517
py
Python
bindings/python/ensmallen/datasets/string/blastomycesdermatitidiser3.py
AnacletoLAB/ensmallen_graph
b2c1b18fb1e5801712852bcc239f239e03076f09
[ "MIT" ]
5
2021-02-17T00:44:45.000Z
2021-08-09T16:41:47.000Z
bindings/python/ensmallen/datasets/string/blastomycesdermatitidiser3.py
AnacletoLAB/ensmallen_graph
b2c1b18fb1e5801712852bcc239f239e03076f09
[ "MIT" ]
18
2021-01-07T16:47:39.000Z
2021-08-12T21:51:32.000Z
bindings/python/ensmallen/datasets/string/blastomycesdermatitidiser3.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 Blastomyces dermatitidis ER-3. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--...
33.495238
223
0.680125
from typing import Dict from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph from ...ensmallen import Graph def BlastomycesDermatitidisEr3( directed: bool = False, preprocess: bool = True, load_nodes: bool = True, verbose: int = 2, cache: bool = True, cache_path: str = "graph...
true
true
f740cf81d062d58dcfa65d8771df1edbc97c41b4
1,358
py
Python
haiku_baselines/TD3/network.py
TinkTheBoush/haiku-baseline
d7c6d270ba3b861e49e4d4d19d057706bcb384ea
[ "MIT" ]
null
null
null
haiku_baselines/TD3/network.py
TinkTheBoush/haiku-baseline
d7c6d270ba3b861e49e4d4d19d057706bcb384ea
[ "MIT" ]
null
null
null
haiku_baselines/TD3/network.py
TinkTheBoush/haiku-baseline
d7c6d270ba3b861e49e4d4d19d057706bcb384ea
[ "MIT" ]
null
null
null
import numpy as np import haiku as hk import jax import jax.numpy as jnp class Actor(hk.Module): def __init__(self,action_size,node=256,hidden_n=2): super(Actor, self).__init__() self.action_size = action_size self.node = node self.hidden_n = hidden_n self.layer = hk.Linear...
30.863636
102
0.522828
import numpy as np import haiku as hk import jax import jax.numpy as jnp class Actor(hk.Module): def __init__(self,action_size,node=256,hidden_n=2): super(Actor, self).__init__() self.action_size = action_size self.node = node self.hidden_n = hidden_n self.layer = hk.Linear...
true
true
f740cffcec0a250513a875beff9dbe87da6c3915
507
py
Python
openchem/layers/ipd.py
YNYuan/OpenChem
4364af6d92ae183aac0bea35726d7ae0ee518920
[ "MIT" ]
null
null
null
openchem/layers/ipd.py
YNYuan/OpenChem
4364af6d92ae183aac0bea35726d7ae0ee518920
[ "MIT" ]
null
null
null
openchem/layers/ipd.py
YNYuan/OpenChem
4364af6d92ae183aac0bea35726d7ae0ee518920
[ "MIT" ]
null
null
null
# modified from https://github.com/tkipf/gae/blob/master/gae/layers.py import torch import torch.nn as nn class InnerProductDecoder(nn.Module): """Decoder model layer for link prediction.""" def __init__(self, input_dim, act=nn.functional.sigmoid): super(InnerProductDecoder, self).__init__() s...
29.823529
70
0.648915
import torch import torch.nn as nn class InnerProductDecoder(nn.Module): def __init__(self, input_dim, act=nn.functional.sigmoid): super(InnerProductDecoder, self).__init__() self.act = act def forward(self, inputs): x = inputs.transpose(1,2) x = torch.mm(inputs, x) x...
true
true
f740d04cf7676ac0b4ced8a752e25a7c21351705
423
py
Python
tests/test_ValWatcher.py
TheBoringBakery/Riot-Watcher
6e05fffe127530a75fd63e67da37ba81489fd4fe
[ "MIT" ]
2
2020-10-06T23:33:01.000Z
2020-11-22T01:58:43.000Z
tests/test_ValWatcher.py
TheBoringBakery/Riot-Watcher
6e05fffe127530a75fd63e67da37ba81489fd4fe
[ "MIT" ]
null
null
null
tests/test_ValWatcher.py
TheBoringBakery/Riot-Watcher
6e05fffe127530a75fd63e67da37ba81489fd4fe
[ "MIT" ]
null
null
null
import pytest from riotwatcher import ValWatcher @pytest.mark.val @pytest.mark.usefixtures("reset_globals") class TestValWatcher: def test_require_api_key(self): with pytest.raises(ValueError): ValWatcher(None) def test_allows_positional_api_key(self): ValWatcher("RGAPI-this-is-a...
23.5
50
0.723404
import pytest from riotwatcher import ValWatcher @pytest.mark.val @pytest.mark.usefixtures("reset_globals") class TestValWatcher: def test_require_api_key(self): with pytest.raises(ValueError): ValWatcher(None) def test_allows_positional_api_key(self): ValWatcher("RGAPI-this-is-a...
true
true
f740d29865b29eaf97a7bc6fbdf1d048c6b3318e
2,143
py
Python
server.py
krustea/surlejaune
14d05c657a13cc4b4882538803d8c21fc57573ae
[ "MIT" ]
null
null
null
server.py
krustea/surlejaune
14d05c657a13cc4b4882538803d8c21fc57573ae
[ "MIT" ]
null
null
null
server.py
krustea/surlejaune
14d05c657a13cc4b4882538803d8c21fc57573ae
[ "MIT" ]
null
null
null
from flask import Flask from temperature import TemperatureSensor from flask_socketio import SocketIO, send, emit from flask import render_template import time import threading import RPi.GPIO as GPIO app = Flask(__name__) degcel = TemperatureSensor() socketio = SocketIO(app) GPIO.setmode(GPIO.BCM) GPIO.setwarnings(Fa...
31.514706
107
0.653756
from flask import Flask from temperature import TemperatureSensor from flask_socketio import SocketIO, send, emit from flask import render_template import time import threading import RPi.GPIO as GPIO app = Flask(__name__) degcel = TemperatureSensor() socketio = SocketIO(app) GPIO.setmode(GPIO.BCM) GPIO.setwarnings(Fa...
true
true
f740d2cd3ecefc7c7524e194ab2a9b7856d1672c
8,038
py
Python
modules/dials/test/command_line/test_reindex.py
jorgediazjr/dials-dev20191018
77d66c719b5746f37af51ad593e2941ed6fbba17
[ "BSD-3-Clause" ]
null
null
null
modules/dials/test/command_line/test_reindex.py
jorgediazjr/dials-dev20191018
77d66c719b5746f37af51ad593e2941ed6fbba17
[ "BSD-3-Clause" ]
null
null
null
modules/dials/test/command_line/test_reindex.py
jorgediazjr/dials-dev20191018
77d66c719b5746f37af51ad593e2941ed6fbba17
[ "BSD-3-Clause" ]
1
2020-02-04T15:39:06.000Z
2020-02-04T15:39:06.000Z
from __future__ import absolute_import, division, print_function import os import procrunner import pytest import six from cctbx import sgtbx from dxtbx.serialize import load from six.moves import cPickle as pickle def pickle_loads(data): if six.PY3: return pickle.loads(data, encoding="bytes") else:...
37.915094
86
0.681388
from __future__ import absolute_import, division, print_function import os import procrunner import pytest import six from cctbx import sgtbx from dxtbx.serialize import load from six.moves import cPickle as pickle def pickle_loads(data): if six.PY3: return pickle.loads(data, encoding="bytes") else:...
true
true
f740d2ef31505865d3e4b5e3c985e83f8a88d010
5,766
py
Python
account/accounts.py
beastpu/ConfigManagement
04a04c0964571d9b88794c627ebcf0d18a2d3f44
[ "Apache-2.0" ]
2
2019-11-27T07:28:19.000Z
2021-06-20T13:10:57.000Z
account/accounts.py
piao100101/Configuration-Management-v1
04a04c0964571d9b88794c627ebcf0d18a2d3f44
[ "Apache-2.0" ]
null
null
null
account/accounts.py
piao100101/Configuration-Management-v1
04a04c0964571d9b88794c627ebcf0d18a2d3f44
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obt...
35.158537
115
0.617412
""" Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the Licen...
false
true
f740d3fc811b90c584a56c98611b71a5ab7ebbc9
171
py
Python
user/vistas/widgets/test/test.py
ZerpaTechnology/occoa
a8c0bd2657bc058801a883109c0ec0d608d04ccc
[ "Apache-2.0" ]
null
null
null
user/vistas/widgets/test/test.py
ZerpaTechnology/occoa
a8c0bd2657bc058801a883109c0ec0d608d04ccc
[ "Apache-2.0" ]
null
null
null
user/vistas/widgets/test/test.py
ZerpaTechnology/occoa
a8c0bd2657bc058801a883109c0ec0d608d04ccc
[ "Apache-2.0" ]
null
null
null
doc+='''<script type="text/javascript" src="''' try: doc+=str(routes.widget_base_url) except Exception as e: doc+=str(e) doc+='''/__javascript__/bootstrap.js"></script>'''
42.75
50
0.695906
doc+='''<script type="text/javascript" src="''' try: doc+=str(routes.widget_base_url) except Exception as e: doc+=str(e) doc+='''/__javascript__/bootstrap.js"></script>'''
true
true
f740d46d5c6d81df35bb3825e17da7e08f0f5d36
1,208
py
Python
cv_segmentation.py
GlitterMcGurk/GAN-Pytorch
b50a3e8f195ebf0c2d7067307c777b254d09b742
[ "MIT" ]
1
2019-02-07T13:33:46.000Z
2019-02-07T13:33:46.000Z
cv_segmentation.py
GlitterMcGurk/GAN-Pytorch
b50a3e8f195ebf0c2d7067307c777b254d09b742
[ "MIT" ]
null
null
null
cv_segmentation.py
GlitterMcGurk/GAN-Pytorch
b50a3e8f195ebf0c2d7067307c777b254d09b742
[ "MIT" ]
1
2019-02-07T13:33:21.000Z
2019-02-07T13:33:21.000Z
import os import numpy as np import cv2 import csv def find_parts(skeleton_reader): for row in skeleton_reader: head_color = (float(row['Head_color_X'].replace(',', '.')), float(row['Head_color_Y'].replace(',', '.'))) head_depth = (float(row['Head_depth_X'].replace(',', '.')), float(row['Head_dep...
33.555556
131
0.64404
import os import numpy as np import cv2 import csv def find_parts(skeleton_reader): for row in skeleton_reader: head_color = (float(row['Head_color_X'].replace(',', '.')), float(row['Head_color_Y'].replace(',', '.'))) head_depth = (float(row['Head_depth_X'].replace(',', '.')), float(row['Head_dep...
false
true
f740d48eda3c8c07e9e9b798be1ed808dd2b0709
399
py
Python
intents/helpers/misc.py
dario-chiappetta/dialogflow_agents
ecb03bdce491a3c9d6769816507f3027fd5a60d1
[ "Apache-2.0" ]
6
2021-06-24T12:22:21.000Z
2021-07-21T21:06:19.000Z
intents/helpers/misc.py
dario-chiappetta/dialogflow_agents
ecb03bdce491a3c9d6769816507f3027fd5a60d1
[ "Apache-2.0" ]
27
2021-06-05T10:41:08.000Z
2021-11-01T17:29:38.000Z
intents/helpers/misc.py
dariowho/intents
ecb03bdce491a3c9d6769816507f3027fd5a60d1
[ "Apache-2.0" ]
null
null
null
import re def camel_to_snake_case(name: str) -> str: """ Source: https://stackoverflow.com/a/1176023 Args: name: A CamelCase name Returns: A snake_case version of the input name """ name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) name = re.sub('__([A-Z])', r'_\1', name) ...
23.470588
54
0.538847
import re def camel_to_snake_case(name: str) -> str: name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) name = re.sub('__([A-Z])', r'_\1', name) name = re.sub('([a-z0-9])([A-Z])', r'\1_\2', name) return name.lower()
true
true
f740d4af7e4f1e2052957ba3a03a534a94d543b5
821
py
Python
Technical-Interview/Searching-and-Sorting/recursion_practice.py
debugtalk/MyUdacity
3e27cab31260b8ae32e8e37773f2536da3853a57
[ "MIT" ]
null
null
null
Technical-Interview/Searching-and-Sorting/recursion_practice.py
debugtalk/MyUdacity
3e27cab31260b8ae32e8e37773f2536da3853a57
[ "MIT" ]
null
null
null
Technical-Interview/Searching-and-Sorting/recursion_practice.py
debugtalk/MyUdacity
3e27cab31260b8ae32e8e37773f2536da3853a57
[ "MIT" ]
null
null
null
"""Implement a function recursivly to get the desired Fibonacci sequence value. Your code should have the same input/output as the iterative code in the instructions.""" compute_mapping = {} def get_fib(position): if position in compute_mapping: return compute_mapping[position] if position <= 1: ...
24.147059
62
0.682095
compute_mapping = {} def get_fib(position): if position in compute_mapping: return compute_mapping[position] if position <= 1: compute_mapping[position] = position return position else: result = get_fib(position - 1) + get_fib(position - 2) compute_mapping[positio...
true
true
f740d534aad0057a6d5f7ca8815ff3d1098ea1f4
1,651
py
Python
horizon/conf/default.py
wilk/horizon
bdf7e692227367a928325acdd31088971d3c4ff4
[ "Apache-2.0" ]
1
2019-08-07T08:46:03.000Z
2019-08-07T08:46:03.000Z
horizon/conf/default.py
wilk/horizon
bdf7e692227367a928325acdd31088971d3c4ff4
[ "Apache-2.0" ]
5
2019-08-14T06:46:03.000Z
2021-12-13T20:01:25.000Z
horizon/conf/default.py
wilk/horizon
bdf7e692227367a928325acdd31088971d3c4ff4
[ "Apache-2.0" ]
2
2020-03-15T01:24:15.000Z
2020-07-22T20:34:26.000Z
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
32.372549
75
0.688674
from django.conf import settings from django.utils.translation import ugettext_lazy as _ HORIZON_CONFIG = { 'dashboards': None, 'default_dashboard': None, 'user_home': settings.LOGIN_REDIRECT_URL, # AJAX settings for JavaScript 'ajax_queue_limit': 10, 'ajax_poll_i...
true
true
f740d586bf758684ed5af24806cf2a09d3c5ce30
15,150
py
Python
heat/tests/openstack/neutron/test_qos.py
odmanV2/heat
76c20f1fc94a06ce5a00730c50952efe19ed0e3e
[ "Apache-2.0" ]
null
null
null
heat/tests/openstack/neutron/test_qos.py
odmanV2/heat
76c20f1fc94a06ce5a00730c50952efe19ed0e3e
[ "Apache-2.0" ]
null
null
null
heat/tests/openstack/neutron/test_qos.py
odmanV2/heat
76c20f1fc94a06ce5a00730c50952efe19ed0e3e
[ "Apache-2.0" ]
null
null
null
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
38.35443
79
0.650363
import mock from heat.common import template_format from heat.engine.clients.os import neutron from heat.engine import rsrc_defn from heat.engine import stack from heat.engine import template from heat.tests import common from heat.tests import utils qos_policy_template = ''' heat_template_version: 2016-...
true
true
f740d587cb0fa254954388a6279fc67f970ea52f
10,091
py
Python
source_code/pypeflow/utils/pump_curve.py
TomLXXVI/pypeflow
49e42621180ec3125afa238d3ca56ae9f3a7662a
[ "MIT" ]
4
2020-05-26T01:11:08.000Z
2021-09-15T20:24:31.000Z
source_code/pypeflow/utils/pump_curve.py
robertspark/pypeflow
49e42621180ec3125afa238d3ca56ae9f3a7662a
[ "MIT" ]
null
null
null
source_code/pypeflow/utils/pump_curve.py
robertspark/pypeflow
49e42621180ec3125afa238d3ca56ae9f3a7662a
[ "MIT" ]
1
2022-01-19T20:26:11.000Z
2022-01-19T20:26:11.000Z
""" ## Pump curve fitting and drawing - Establish an equation for the pump curve from measured points on the curve in the pump's data sheet - Get the coefficients of the 2nd order polynomial describing the pump curve and determined via curve fitting - Draw the pump curve in a diagram """ from typing import List, Tupl...
42.221757
118
0.591418
from typing import List, Tuple, Dict, Optional import numpy as np import quantities as qty from nummath.interpolation import PolyFit from nummath.graphing2 import LineGraph class PumpCurve: def __init__(self, dest_units: Dict[str, str]): self._meas_points: List[Tuple[qty.VolumeFlowRate, qty.Pressure]] = ...
true
true
f740d5a6c8c68955227b1c3da87d7490a4772e8b
281
py
Python
python/hello.py
jspc/hello-world-so
619e25608235ea33e32dc9f20dda6aa77b1f119a
[ "MIT" ]
null
null
null
python/hello.py
jspc/hello-world-so
619e25608235ea33e32dc9f20dda6aa77b1f119a
[ "MIT" ]
null
null
null
python/hello.py
jspc/hello-world-so
619e25608235ea33e32dc9f20dda6aa77b1f119a
[ "MIT" ]
null
null
null
import ctypes import os lib_path = os.path.join(os.path.dirname(__file__), '..', 'strings.so') lib = ctypes.CDLL(lib_path) hello = lib.C_Hello hello.argtype = ctypes.c_int hello.restype = ctypes.c_char_p print("Running from python") print(lib.C_Hello(0)) print(lib.C_Hello(1))
18.733333
70
0.736655
import ctypes import os lib_path = os.path.join(os.path.dirname(__file__), '..', 'strings.so') lib = ctypes.CDLL(lib_path) hello = lib.C_Hello hello.argtype = ctypes.c_int hello.restype = ctypes.c_char_p print("Running from python") print(lib.C_Hello(0)) print(lib.C_Hello(1))
true
true
f740d5f3a2d2c9cc9cda97c2ca1c2e1596a6bee0
441
py
Python
data_dict.py
EnginKosure/CustomerChurnPredictionModel
4ff67778653809c02b27727b8e375985ec17b826
[ "MIT" ]
null
null
null
data_dict.py
EnginKosure/CustomerChurnPredictionModel
4ff67778653809c02b27727b8e375985ec17b826
[ "MIT" ]
5
2021-01-13T22:38:13.000Z
2021-01-14T08:26:50.000Z
data_dict.py
EnginKosure/CustomerChurnPredictionModel
4ff67778653809c02b27727b8e375985ec17b826
[ "MIT" ]
null
null
null
findings = { 'a': 'AutoML and high-code model trials return almost the same output', 'b': 'AutoML makes data-cleaning and feature selection implicitly', 'c': 'Quality and relevance of the data is the main determinant', 'd': 'Consuming the model via web interface could provide a better UX', 'p': 'is ...
49
75
0.69161
findings = { 'a': 'AutoML and high-code model trials return almost the same output', 'b': 'AutoML makes data-cleaning and feature selection implicitly', 'c': 'Quality and relevance of the data is the main determinant', 'd': 'Consuming the model via web interface could provide a better UX', 'p': 'is ...
true
true
f740d63164ac44c7eb37110a88036787f94655e5
1,188
py
Python
limix/core/covar/test/test_ZKZ.py
PMBio/limix
578cba203cb9b9828a514a6ebb5d8c5b11d3445a
[ "Apache-2.0" ]
65
2015-01-20T20:46:26.000Z
2021-06-27T14:40:35.000Z
limix/core/covar/test/test_ZKZ.py
PMBio/limix
578cba203cb9b9828a514a6ebb5d8c5b11d3445a
[ "Apache-2.0" ]
29
2015-02-01T22:35:17.000Z
2017-08-07T08:18:23.000Z
limix/core/covar/test/test_ZKZ.py
PMBio/limix
578cba203cb9b9828a514a6ebb5d8c5b11d3445a
[ "Apache-2.0" ]
35
2015-02-01T17:26:50.000Z
2019-09-13T07:06:16.000Z
import unittest import numpy as np from limix.core.covar.zkz import ZKZCov from limix.utils.check_grad import mcheck_grad import scipy as sp class TestZKZ(unittest.TestCase): def setUp(self): np.random.seed() print '\n\n\n' print np.random.randn(1) print '\n\n\n' self._X = n...
25.276596
67
0.56734
import unittest import numpy as np from limix.core.covar.zkz import ZKZCov from limix.utils.check_grad import mcheck_grad import scipy as sp class TestZKZ(unittest.TestCase): def setUp(self): np.random.seed() print '\n\n\n' print np.random.randn(1) print '\n\n\n' self._X = n...
false
true
f740d7d8967ee0abe39c4aa4fb48a83cb44ce30e
1,259
py
Python
haziris/datatables/datatables.py
haziris/haziris-python
c078b6bc73187ba1cfa24b3dbcf7979a6d17e9c2
[ "BSD-3-Clause" ]
1
2020-08-27T06:25:58.000Z
2020-08-27T06:25:58.000Z
haziris/datatables/datatables.py
haziris/haziris-python
c078b6bc73187ba1cfa24b3dbcf7979a6d17e9c2
[ "BSD-3-Clause" ]
null
null
null
haziris/datatables/datatables.py
haziris/haziris-python
c078b6bc73187ba1cfa24b3dbcf7979a6d17e9c2
[ "BSD-3-Clause" ]
null
null
null
import json DATATABLES_HTML = """ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Haziris: Datatable</title> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"> <style> #haziris-datatables{ padding:5%; } #hazi...
22.482143
113
0.620334
import json DATATABLES_HTML = """ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Haziris: Datatable</title> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"> <style> #haziris-datatables{ padding:5%; } #hazi...
true
true
f740d8c67e8bfbd5625c41eff9bceca0be2e87c7
4,640
py
Python
sinergym/utils/controllers.py
jajimer/sinergym
685bcb3cda8095eef1add2b5d12e0ce102efefe9
[ "MIT" ]
23
2021-10-30T15:42:24.000Z
2022-03-29T13:27:39.000Z
sinergym/utils/controllers.py
jajimer/sinergym
685bcb3cda8095eef1add2b5d12e0ce102efefe9
[ "MIT" ]
93
2021-09-30T09:05:31.000Z
2022-03-31T18:11:57.000Z
sinergym/utils/controllers.py
jajimer/sinergym
685bcb3cda8095eef1add2b5d12e0ce102efefe9
[ "MIT" ]
7
2021-11-24T10:28:42.000Z
2022-03-04T14:11:29.000Z
"""Implementation of basic controllers.""" from datetime import datetime from typing import Any, List, Sequence from ..utils.common import parse_variables class RandomController(object): def __init__(self, env: Any): """Random agent. It selects available actions randomly. Args: env ...
33.623188
108
0.648922
from datetime import datetime from typing import Any, List, Sequence from ..utils.common import parse_variables class RandomController(object): def __init__(self, env: Any): self.env = env def act(self) -> Sequence[Any]: action = self.env.action_space.sample() return action class ...
true
true
f740d9f4c502108231d85ed13faca3b33e41e085
4,825
py
Python
.cmake-format.py
dkavolis/imgui_vulkan
de1ef85a748d474a385d250ad946c230629c8e15
[ "MIT" ]
null
null
null
.cmake-format.py
dkavolis/imgui_vulkan
de1ef85a748d474a385d250ad946c230629c8e15
[ "MIT" ]
null
null
null
.cmake-format.py
dkavolis/imgui_vulkan
de1ef85a748d474a385d250ad946c230629c8e15
[ "MIT" ]
null
null
null
# -------------------------- # General Formatting Options # -------------------------- # How wide to allow formatted cmake files line_width = 120 # How many spaces to tab for indent tab_size = 2 # If an argument group contains more than this many sub-groups (parg or kwarg # groups), then force it to a verti...
30.929487
81
0.681451
line_width = 120 tab_size = 2 max_subgroups_hwrap = 4 max_pargs_hwrap = 6 separate_ctrl_name_with_space = False separate_fn_name_with_space = False dangle_parens = False # If the trailing parenthesis must be 'dangled' on it's on line, then align it dangle_align = 'prefix' min_pr...
true
true
f740da48de7aabf822e247b8ed215fb20ccb98b7
581
py
Python
strings.py
widodom/hello-world
95a9e650b89bae2c2cd40fec82aff97a778bab6f
[ "MIT" ]
null
null
null
strings.py
widodom/hello-world
95a9e650b89bae2c2cd40fec82aff97a778bab6f
[ "MIT" ]
null
null
null
strings.py
widodom/hello-world
95a9e650b89bae2c2cd40fec82aff97a778bab6f
[ "MIT" ]
null
null
null
name = input('enter your name: ') age = input('enter your age: ') print('My name is %s and I am %s years old' % (name, age)) print('My name is {} and I am {} years old'.format(name, age)) print('My name is {name} and I am {age} years old'.format(age=99, name='Ryan')) # This last one is more fancy than most people us...
29.05
79
0.648881
name = input('enter your name: ') age = input('enter your age: ') print('My name is %s and I am %s years old' % (name, age)) print('My name is {} and I am {} years old'.format(name, age)) print('My name is {name} and I am {age} years old'.format(age=99, name='Ryan')) my_info = { 'name': 'Ryan', 'age': 99, ...
true
true
f740db0c0787cdce6493ee2dfb23fc20fc6451a3
9,135
py
Python
closed/Lenovo/code/common/__init__.py
ctuning/inference_results_v1.1
d9176eca28fcf6d7a05ccb97994362a76a1eb5ab
[ "Apache-2.0" ]
12
2021-09-23T08:05:57.000Z
2022-03-21T03:52:11.000Z
closed/Lenovo/code/common/__init__.py
ctuning/inference_results_v1.1
d9176eca28fcf6d7a05ccb97994362a76a1eb5ab
[ "Apache-2.0" ]
11
2021-09-23T20:34:06.000Z
2022-01-22T07:58:02.000Z
closed/Lenovo/code/common/__init__.py
ctuning/inference_results_v1.1
d9176eca28fcf6d7a05ccb97994362a76a1eb5ab
[ "Apache-2.0" ]
16
2021-09-23T20:26:38.000Z
2022-03-09T12:59:56.000Z
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
36.394422
169
0.627805
import os import sys sys.path.insert(0, os.getcwd()) import json import platform import subprocess import sys import re from glob import glob VERSION = "v1.0" import logging logging.basicConfig(level=logging.INFO, format="[%(asctime)s %(filename)s:%(lineno)d %(levelname)s] %(message)s") from code.co...
true
true