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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c123b1216509fd1168effa0cd0d1a96d17f746c | 8,630 | py | Python | tests/contrib/utils/gcp_authenticator.py | robyoung-digital/airflow | 068ded96cd279dcd51f5b6d1e96f09205ecf40c8 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-07-07T13:42:38.000Z | 2021-07-07T13:42:38.000Z | tests/contrib/utils/gcp_authenticator.py | robyoung-digital/airflow | 068ded96cd279dcd51f5b6d1e96f09205ecf40c8 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2019-01-22T22:03:29.000Z | 2019-01-31T23:08:35.000Z | tests/contrib/utils/gcp_authenticator.py | robyoung-digital/airflow | 068ded96cd279dcd51f5b6d1e96f09205ecf40c8 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-01-24T00:20:15.000Z | 2020-01-24T00:20:15.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 39.406393 | 110 | 0.635574 | import json
import os
import subprocess
from airflow import settings, AirflowException
from tests.contrib.utils.logging_command_executor import LoggingCommandExecutor
from airflow.models.connection import Connection
GCP_COMPUTE_KEY = 'gcp_compute.json'
GCP_FUNCTION_KEY = 'gcp_function.json'
GCP_CLOUDSQL_KEY = 'gcp_c... | true | true |
1c123b5beaa0d5b97e4710bd73c1b647959d9268 | 57,337 | py | Python | app.py | grantseiter/OECD-Corporate-Tax-Burden-App | bdf4029af7ee393814de72bb983bda37fe6c9d78 | [
"MIT"
] | null | null | null | app.py | grantseiter/OECD-Corporate-Tax-Burden-App | bdf4029af7ee393814de72bb983bda37fe6c9d78 | [
"MIT"
] | null | null | null | app.py | grantseiter/OECD-Corporate-Tax-Burden-App | bdf4029af7ee393814de72bb983bda37fe6c9d78 | [
"MIT"
] | null | null | null | import os
import pandas as pd
import numpy as np
import plotly.io as pio
import plotly.graph_objects as go
import dash
from dash import dcc
from dash import html
from dash import dash_table
from dash.dependencies import Input, Output
import base64
image_filename = "assets/aei_logo.png"
encoded_image = base64.b64encode... | 48.922355 | 936 | 0.500724 | import os
import pandas as pd
import numpy as np
import plotly.io as pio
import plotly.graph_objects as go
import dash
from dash import dcc
from dash import html
from dash import dash_table
from dash.dependencies import Input, Output
import base64
image_filename = "assets/aei_logo.png"
encoded_image = base64.b64encode... | true | true |
1c123bc470dae41badf8cbce1184a9a220166428 | 57,375 | py | Python | src/sentry/south_migrations/0191_auto__del_alert__del_alertrelatedgroup__del_unique_alertrelatedgroup_g.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 2 | 2019-03-04T12:45:54.000Z | 2019-03-04T12:45:55.000Z | src/sentry/south_migrations/0191_auto__del_alert__del_alertrelatedgroup__del_unique_alertrelatedgroup_g.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 196 | 2019-06-10T08:34:10.000Z | 2022-02-22T01:26:13.000Z | src/sentry/south_migrations/0191_auto__del_alert__del_alertrelatedgroup__del_unique_alertrelatedgroup_g.py | uandco/sentry | 5b8d45cb71c6617dac8e64265848623fbfce9c99 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T06:36:57.000Z | 2017-02-09T06:36:57.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'AlertRelatedGroup', fields ['group', 'alert']
... | 36.474889 | 96 | 0.397839 | from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.delete_unique(u'sentry_alertrelatedgroup', ['group_id', 'alert_id'])
db.delete... | true | true |
1c123cd52fa33ef58658de2ca42afc5b2ddc37fc | 492 | py | Python | tests/hass-addon-sunsynk/test_mqtt.py | lispwarez/sunsynk | a9a89265b4eed3e15d49e9ab4c68d7b49afcce19 | [
"MIT"
] | 11 | 2021-11-02T20:16:38.000Z | 2022-03-21T19:22:43.000Z | tests/hass-addon-sunsynk/test_mqtt.py | kellerza/sunsynk | 51cc5418213b1255521c3179db40f63d4fbca67f | [
"MIT"
] | 27 | 2021-11-11T07:29:22.000Z | 2022-03-28T16:26:05.000Z | tests/hass-addon-sunsynk/test_mqtt.py | lispwarez/sunsynk | a9a89265b4eed3e15d49e9ab4c68d7b49afcce19 | [
"MIT"
] | 10 | 2021-11-06T09:54:53.000Z | 2022-03-28T10:02:15.000Z | """Test MQTT class."""
import logging
from types import ModuleType
import pytest
from tests.conftest import import_module
_LOGGER = logging.getLogger(__name__)
@pytest.fixture
def mqtt() -> ModuleType:
"""Import the mqtt module."""
mqttmod = import_module("mqtt", "hass-addon-sunsynk")
_LOGGER.warning("... | 20.5 | 57 | 0.703252 | import logging
from types import ModuleType
import pytest
from tests.conftest import import_module
_LOGGER = logging.getLogger(__name__)
@pytest.fixture
def mqtt() -> ModuleType:
mqttmod = import_module("mqtt", "hass-addon-sunsynk")
_LOGGER.warning("Module mqtt: %s", dir(mqttmod))
return mqttmod
@pyt... | true | true |
1c123dd93dcf80a28cdbcaec34fa36f7ed9d6e8f | 1,283 | py | Python | taskbuster/apps/taskmanager/models-original.py | davidwurster/taskbuster_project | c9d624ac6cae20d2cd1dedec0236731a2c9e1822 | [
"MIT"
] | null | null | null | taskbuster/apps/taskmanager/models-original.py | davidwurster/taskbuster_project | c9d624ac6cae20d2cd1dedec0236731a2c9e1822 | [
"MIT"
] | null | null | null | taskbuster/apps/taskmanager/models-original.py | davidwurster/taskbuster_project | c9d624ac6cae20d2cd1dedec0236731a2c9e1822 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
#from . import managers
from taskbuster.apps import managers
class Profile(models.Model):
# Relations
user = models.OneToOneField(
settings.AUTH_USER_MODEL,... | 25.156863 | 69 | 0.663289 | from django.db import models
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from taskbuster.apps import managers
class Profile(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
related_name= "pr... | true | true |
1c123e0fd8b1e0cd434fa3aff7b6239e19ba3dee | 1,422 | py | Python | aliyun-python-sdk-facebody/aliyunsdkfacebody/request/v20191230/DetectMaskRequest.py | silent-beaters/aliyun-openapi-python-sdk | 7a025eabdad622af07affc3a7beeae1c5def469d | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-facebody/aliyunsdkfacebody/request/v20191230/DetectMaskRequest.py | silent-beaters/aliyun-openapi-python-sdk | 7a025eabdad622af07affc3a7beeae1c5def469d | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-facebody/aliyunsdkfacebody/request/v20191230/DetectMaskRequest.py | silent-beaters/aliyun-openapi-python-sdk | 7a025eabdad622af07affc3a7beeae1c5def469d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.421053 | 74 | 0.766526 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkfacebody.endpoint import endpoint_data
class DetectMaskRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'facebody', '2019-12-30', 'DetectMask')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endpoint_map... | true | true |
1c123fc605c3fd13db456684cc60b47c985489f8 | 14,016 | py | Python | dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py | swg-liuge/dolphinscheduler | 3456904af8601556cecff5a07b260d092ca13bcb | [
"Apache-2.0"
] | 2 | 2022-02-18T07:28:18.000Z | 2022-02-18T07:28:21.000Z | dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py | swg-liuge/dolphinscheduler | 3456904af8601556cecff5a07b260d092ca13bcb | [
"Apache-2.0"
] | 1 | 2021-12-14T09:28:39.000Z | 2021-12-14T09:28:39.000Z | dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py | swg-liuge/dolphinscheduler | 3456904af8601556cecff5a07b260d092ca13bcb | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.393939 | 107 | 0.628639 |
import json
from datetime import datetime
from typing import Any, Dict, List, Optional, Set
from pydolphinscheduler.constants import (
ProcessDefinitionDefault,
ProcessDefinitionReleaseState,
TaskType,
)
from pydolphinscheduler.core.base import Base
from pydolphinscheduler.exceptions import PyDSParamExce... | true | true |
1c12409e7b941d82d961643898b671d2b0b368c5 | 558 | py | Python | setup.py | j6k4m8/PyTablePrinter | 970d098ec6803a950472b40106173e9807cde97c | [
"MIT"
] | 4 | 2016-02-07T08:19:09.000Z | 2022-02-08T14:07:12.000Z | setup.py | j6k4m8/PyTablePrinter | 970d098ec6803a950472b40106173e9807cde97c | [
"MIT"
] | null | null | null | setup.py | j6k4m8/PyTablePrinter | 970d098ec6803a950472b40106173e9807cde97c | [
"MIT"
] | 1 | 2015-12-30T17:37:33.000Z | 2015-12-30T17:37:33.000Z | from distutils.core import setup
import PyTablePrinter
VERSION = PyTablePrinter.version
setup(
name = 'PyTablePrinter',
packages = [
'PyTablePrinter'
],
version = VERSION,
description = 'A Python library for generating markdown tables',
author = 'Jordan Matelsky',
author_email = 'j... | 24.26087 | 81 | 0.648746 | from distutils.core import setup
import PyTablePrinter
VERSION = PyTablePrinter.version
setup(
name = 'PyTablePrinter',
packages = [
'PyTablePrinter'
],
version = VERSION,
description = 'A Python library for generating markdown tables',
author = 'Jordan Matelsky',
author_email = 'j... | true | true |
1c1240a7f84c8c7d3476a54f09bb0bc7357c7264 | 1,596 | py | Python | setup.py | jihun-hong/snap-python | 928a779b71c501103c69a6c32a6011b369947fa4 | [
"BSD-3-Clause"
] | 242 | 2015-01-01T08:40:28.000Z | 2022-03-18T05:22:09.000Z | setup.py | jihun-hong/snap-python | 928a779b71c501103c69a6c32a6011b369947fa4 | [
"BSD-3-Clause"
] | 99 | 2015-01-24T07:55:27.000Z | 2021-10-30T18:20:13.000Z | setup.py | jihun-hong/snap-python | 928a779b71c501103c69a6c32a6011b369947fa4 | [
"BSD-3-Clause"
] | 105 | 2015-03-03T06:45:17.000Z | 2022-02-24T15:52:40.000Z | """
setup.py file for SNAP (Stanford Network Analysis Platform) Python
Linux version, generated on CentOS, tested on Ubuntu as well
"""
import os
import shutil
import subprocess
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
SNAPPY_VERSION = "5.1.0.dev0"
class SwigEx... | 26.6 | 82 | 0.666667 | import os
import shutil
import subprocess
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
SNAPPY_VERSION = "5.1.0.dev0"
class SwigExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
self.sourcedir = ... | true | true |
1c124203d55848fe186226b0c5cc3346b1da92d3 | 2,158 | py | Python | examples/postgresql/core.py | ghga-de/ghga-service-chassis-lib | 7a4d544386a88bec961601f2f838a6a955df6698 | [
"Apache-2.0"
] | 1 | 2021-07-20T07:47:24.000Z | 2021-07-20T07:47:24.000Z | examples/postgresql/core.py | ghga-de/ghga-service-chassis-lib | 7a4d544386a88bec961601f2f838a6a955df6698 | [
"Apache-2.0"
] | 20 | 2021-07-02T14:38:57.000Z | 2022-02-09T10:42:41.000Z | examples/postgresql/core.py | ghga-de/ghga-service-chassis-lib | 7a4d544386a88bec961601f2f838a6a955df6698 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 - 2022 Universität Tübingen, DKFZ and EMBL
# for the German Human Genome-Phenome Archive (GHGA)
#
# 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/... | 34.253968 | 84 | 0.680259 |
from datetime import datetime, timedelta, timezone
import typer
from . import models
from .config import CONFIG, Config
from .dao import Database
async def add_some_todos(config: Config = CONFIG):
tomorrow = datetime.now(timezone.utc) + timedelta(1)
yesterday = datetime.now(timezone.utc) - timedelta(1)
... | true | true |
1c1242f14f1b195086d89adc0df437d4b5772b2a | 5,969 | py | Python | isi_sdk_8_2_1/isi_sdk_8_2_1/models/file_filter_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_1/isi_sdk_8_2_1/models/file_filter_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_1/isi_sdk_8_2_1/models/file_filter_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 8
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class FileFilterSettingsSettings... | 33.723164 | 118 | 0.638465 |
import pprint
import re
import six
class FileFilterSettingsSettings(object):
swagger_types = {
'file_filter_extensions': 'list[str]',
'file_filter_type': 'str',
'file_filtering_enabled': 'bool'
}
attribute_map = {
'file_filter_extensions': 'file_filter_extensions',
... | true | true |
1c124328286c659d800d2c44a2c4e4fee15f26e5 | 1,775 | py | Python | configs/mask_rcnn/mask_rcnn_x101_32x8d_fpn_mstrain-poly_1x_coco.py | evgps/mmdetection_trashcan | aaf4237c2c0d473425cdc7b741d3009177b79751 | [
"Apache-2.0"
] | 426 | 2020-10-16T08:09:27.000Z | 2022-03-30T03:36:04.000Z | configs/mask_rcnn/mask_rcnn_x101_32x8d_fpn_mstrain-poly_1x_coco.py | evgps/mmdetection_trashcan | aaf4237c2c0d473425cdc7b741d3009177b79751 | [
"Apache-2.0"
] | 170 | 2020-09-08T12:29:06.000Z | 2022-03-31T18:28:09.000Z | configs/mask_rcnn/mask_rcnn_x101_32x8d_fpn_mstrain-poly_1x_coco.py | evgps/mmdetection_trashcan | aaf4237c2c0d473425cdc7b741d3009177b79751 | [
"Apache-2.0"
] | 84 | 2021-05-29T06:58:14.000Z | 2022-03-31T07:44:10.000Z | _base_ = './mask_rcnn_r101_fpn_1x_coco.py'
model = dict(
pretrained='open-mmlab://detectron2/resnext101_32x8d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=8,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dic... | 30.084746 | 77 | 0.584225 | _base_ = './mask_rcnn_r101_fpn_1x_coco.py'
model = dict(
pretrained='open-mmlab://detectron2/resnext101_32x8d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=8,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dic... | true | true |
1c1243887118d14a898d9dade39705496ad9ebd6 | 10,406 | py | Python | examples/Pipeline/PaddleOCR/ocr/web_service.py | felixhjh/Serving | 3979a174f1a5c905b11545dbeb9db27b5a83243b | [
"Apache-2.0"
] | null | null | null | examples/Pipeline/PaddleOCR/ocr/web_service.py | felixhjh/Serving | 3979a174f1a5c905b11545dbeb9db27b5a83243b | [
"Apache-2.0"
] | null | null | null | examples/Pipeline/PaddleOCR/ocr/web_service.py | felixhjh/Serving | 3979a174f1a5c905b11545dbeb9db27b5a83243b | [
"Apache-2.0"
] | 1 | 2022-02-25T07:51:05.000Z | 2022-02-25T07:51:05.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 39.56654 | 131 | 0.580242 | from paddle_serving_server.web_service import WebService, Op
import logging
import numpy as np
import cv2
import base64
from paddle_serving_app.reader import OCRReader
from paddle_serving_app.reader import Sequential, ResizeByFactor
from paddle_serving_app.reader import Div, Normalize, Transpose
from paddle_serving_app... | true | true |
1c12441f2a2fb5ab5a6b96a0c0c01be3eb817023 | 537 | py | Python | examples/pybuilder/fuzz_exe.py | MJ-SEO/py_fuzz | 789fbfea21bf644ba4d00554fe4141694b0a190a | [
"Apache-2.0"
] | null | null | null | examples/pybuilder/fuzz_exe.py | MJ-SEO/py_fuzz | 789fbfea21bf644ba4d00554fe4141694b0a190a | [
"Apache-2.0"
] | null | null | null | examples/pybuilder/fuzz_exe.py | MJ-SEO/py_fuzz | 789fbfea21bf644ba4d00554fe4141694b0a190a | [
"Apache-2.0"
] | null | null | null | from pythonfuzz.main import PythonFuzz
from pybuilder.errors import PyBuilderException
from pybuilder.core import *
from pybuilder.scaffolding import *
import tempfile
@PythonFuzz
def fuzz(buf):
try:
p_name = buf.decode("ascii")
with tempfile.TemporaryDirectory() as tempDir:
pass
project = Project(basedir= ... | 22.375 | 52 | 0.77095 | from pythonfuzz.main import PythonFuzz
from pybuilder.errors import PyBuilderException
from pybuilder.core import *
from pybuilder.scaffolding import *
import tempfile
@PythonFuzz
def fuzz(buf):
try:
p_name = buf.decode("ascii")
with tempfile.TemporaryDirectory() as tempDir:
pass
project = Project(basedir= ... | true | true |
1c124444117d0da8b294ea256f81351369b8a20c | 2,514 | py | Python | py/acc-client.py/bridge_global.py | giuliobosco/domotics | b327a94e319c379148b3a0ec1d840d820bb1c4bd | [
"MIT"
] | 2 | 2019-05-09T14:04:30.000Z | 2019-05-10T07:29:07.000Z | py/acc-client.py/bridge_global.py | giuliobosco/domotics | b327a94e319c379148b3a0ec1d840d820bb1c4bd | [
"MIT"
] | null | null | null | py/acc-client.py/bridge_global.py | giuliobosco/domotics | b327a94e319c379148b3a0ec1d840d820bb1c4bd | [
"MIT"
] | 1 | 2018-05-29T20:49:50.000Z | 2018-05-29T20:49:50.000Z | """
The MIT License
Copyright 2019 giuliobosco.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 33.078947 | 92 | 0.693715 |
import sys
sys.path.insert(0, '/usr/lib/python2.7/bridge')
from threading import Lock
from bridgeclient import BridgeClient
class BridgeGlobal:
def __init__(self):
self.bridge = BridgeClient()
self.lock = Lock()
def get(self, key):
self.lock.acquire()
... | true | true |
1c1244c23055496a5c288fb17402e1579993ab7d | 2,805 | py | Python | face_detection.py | clamsproject/app-dlib-facedetection-wrapper | ff3b28ac19bc054ec496f94ea465a6890674eacc | [
"Apache-2.0"
] | 1 | 2021-01-17T19:54:55.000Z | 2021-01-17T19:54:55.000Z | face_detection.py | clamsproject/app-dlib-facedetection-wrapper | ff3b28ac19bc054ec496f94ea465a6890674eacc | [
"Apache-2.0"
] | null | null | null | face_detection.py | clamsproject/app-dlib-facedetection-wrapper | ff3b28ac19bc054ec496f94ea465a6890674eacc | [
"Apache-2.0"
] | null | null | null | import cv2
import dlib
#import face_recognition
from clams.serve import ClamApp
from clams.serialize import *
from clams.vocab import AnnotationTypes
from clams.vocab import MediaTypes
from clams.restify import Restifier
class FaceDetection(ClamApp):
def appmetadata(self):
metadata = {"name": "Face Dete... | 35.506329 | 129 | 0.60713 | import cv2
import dlib
from clams.serve import ClamApp
from clams.serialize import *
from clams.vocab import AnnotationTypes
from clams.vocab import MediaTypes
from clams.restify import Restifier
class FaceDetection(ClamApp):
def appmetadata(self):
metadata = {"name": "Face Detection",
... | true | true |
1c1246a7db75b0c4a2dbdfde7d1fad98c40f2704 | 1,226 | py | Python | von_anchor/__init__.py | ianco/von_anchor | ec19cda85a934307d5338858bc4fb323306e5b21 | [
"Apache-2.0"
] | null | null | null | von_anchor/__init__.py | ianco/von_anchor | ec19cda85a934307d5338858bc4fb323306e5b21 | [
"Apache-2.0"
] | null | null | null | von_anchor/__init__.py | ianco/von_anchor | ec19cda85a934307d5338858bc4fb323306e5b21 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-2019 Government of Canada - Public Services and Procurement Canada - buyandsell.gc.ca
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
... | 30.65 | 114 | 0.76509 |
from .anchor.demo import NominalAnchor, OrgBookAnchor, OrgHubAnchor, ProctorAnchor, RegistrarAnchor, TrusteeAnchor
from .anchor.holderprover import HolderProver
from .anchor.issuer import Issuer
from .anchor.origin import Origin
from .anchor.rrbuilder import RevRegBuilder
from .anchor.smith import AnchorSmith
from .a... | true | true |
1c124776ba33da3f30f75023028e54aadc5a1291 | 28,621 | py | Python | models/gap/exec.py | airxiechao/gap | 1262bb7063da95011479839b4ccb4d9ed2e97020 | [
"MIT"
] | 29 | 2019-06-08T11:45:57.000Z | 2022-03-24T15:02:34.000Z | models/gap/exec.py | airxiechao/gap | 1262bb7063da95011479839b4ccb4d9ed2e97020 | [
"MIT"
] | 14 | 2019-12-07T02:03:46.000Z | 2022-02-09T23:30:20.000Z | models/gap/exec.py | airxiechao/gap | 1262bb7063da95011479839b4ccb4d9ed2e97020 | [
"MIT"
] | 8 | 2019-06-11T03:44:43.000Z | 2022-01-19T20:43:10.000Z | import argparse
import csv
import logging
import os
import random
import sys
import shutil
import contextlib
import numpy as np
import pandas as pd
import torch
from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,
TensorDataset)
from torch.utils.data.distributed imp... | 44.930926 | 131 | 0.500122 | import argparse
import csv
import logging
import os
import random
import sys
import shutil
import contextlib
import numpy as np
import pandas as pd
import torch
from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,
TensorDataset)
from torch.utils.data.distributed imp... | true | true |
1c1247c6555d048cd9a603564f0f82d23075c0bb | 6,188 | py | Python | AI/kaggle/forest_cover/eda/eda.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | null | null | null | AI/kaggle/forest_cover/eda/eda.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | 3 | 2020-03-24T16:26:35.000Z | 2020-04-15T19:40:41.000Z | AI/kaggle/forest_cover/eda/eda.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# competition src: https://www.kaggle.com/c/forest-cover-type-prediction
# data src: https://www.kaggle.com/c/3936/download-all
# In[2]:
import gc
gc.collect()
# In[160]:
# Load libraries
import re
import numpy as np
get_ipython().run_line_magic('matplotlib',... | 24.458498 | 115 | 0.694732 |
import gc
gc.collect()
import re
import numpy as np
get_ipython().run_line_magic('matplotlib', 'inline')
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
TRAIN_FILEPATH = 'data/train.csv'
train_df = pd.read_csv( TRAIN_FILEPATH, header=0 )
TEST_FILEPATH = 'data/test.csv'
tes... | true | true |
1c12484a1a88e83df0f4556ee0a92f4012ea1483 | 4,850 | py | Python | api/v1/project.py | muslax/aces-api | 9d56f68277c284bd6985e13dca7f993e9db1b70f | [
"MIT"
] | null | null | null | api/v1/project.py | muslax/aces-api | 9d56f68277c284bd6985e13dca7f993e9db1b70f | [
"MIT"
] | 1 | 2020-08-17T04:17:58.000Z | 2020-08-17T04:17:58.000Z | api/v1/project.py | muslax/aces-api | 9d56f68277c284bd6985e13dca7f993e9db1b70f | [
"MIT"
] | 2 | 2020-08-16T11:59:34.000Z | 2020-08-26T05:35:07.000Z | import logging
from typing import Any, List
from bson.objectid import ObjectId
from fastapi import APIRouter, Depends
from crud import project as crud
from crud.client import find_one as find_client
from crud.contract import find_one as find_contract
from crud.license import find_one as find_license
from models.base ... | 29.041916 | 90 | 0.689691 | import logging
from typing import Any, List
from bson.objectid import ObjectId
from fastapi import APIRouter, Depends
from crud import project as crud
from crud.client import find_one as find_client
from crud.contract import find_one as find_contract
from crud.license import find_one as find_license
from models.base ... | true | true |
1c1249c9e816435a9dc2b4695829b7ec14e073d6 | 856 | py | Python | doper/scenes/multiple_scenes.py | VGGVRobotics/doper | d0ebb9bc8ad9c326deac0b457769d04a92066f11 | [
"MIT"
] | 1 | 2020-11-05T10:11:31.000Z | 2020-11-05T10:11:31.000Z | doper/scenes/multiple_scenes.py | VGGVRobotics/doper | d0ebb9bc8ad9c326deac0b457769d04a92066f11 | [
"MIT"
] | null | null | null | doper/scenes/multiple_scenes.py | VGGVRobotics/doper | d0ebb9bc8ad9c326deac0b457769d04a92066f11 | [
"MIT"
] | null | null | null | __all__ = ["MultipleScenes"]
import logging
from glob import glob
import numpy as onp
from doper.utils.assets import get_svg_scene
from .single_scene import SingleScene
logger = logging.getLogger(__name__)
class MultipleScenes():
def __init__(self, config: dict):
self.config = config
scene_pat... | 30.571429 | 79 | 0.702103 | __all__ = ["MultipleScenes"]
import logging
from glob import glob
import numpy as onp
from doper.utils.assets import get_svg_scene
from .single_scene import SingleScene
logger = logging.getLogger(__name__)
class MultipleScenes():
def __init__(self, config: dict):
self.config = config
scene_pat... | true | true |
1c1249d9bfc0212f5bf753acfba6667ce9f02d7e | 41 | py | Python | satchmo/apps/satchmo_store/contact/__init__.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | 16 | 2015-03-06T14:42:27.000Z | 2019-12-23T21:37:01.000Z | satchmo/apps/satchmo_store/contact/__init__.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | null | null | null | satchmo/apps/satchmo_store/contact/__init__.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | 8 | 2015-01-28T16:02:37.000Z | 2022-03-03T21:29:40.000Z | CUSTOMER_ID = 'custID'
import listeners
| 10.25 | 22 | 0.780488 | CUSTOMER_ID = 'custID'
import listeners
| true | true |
1c124a382dc270f2f6f5a7689f5349946c4c7ca3 | 3,134 | py | Python | book_spider/book_spider/settings.py | SuooL/BookSpider | fd090966dcfe2530d6776ea37800e493df44d701 | [
"MIT"
] | null | null | null | book_spider/book_spider/settings.py | SuooL/BookSpider | fd090966dcfe2530d6776ea37800e493df44d701 | [
"MIT"
] | null | null | null | book_spider/book_spider/settings.py | SuooL/BookSpider | fd090966dcfe2530d6776ea37800e493df44d701 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for book_spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest... | 34.43956 | 103 | 0.776962 |
BOT_NAME = 'book_spider'
SPIDER_MODULES = ['book_spider.spiders']
NEWSPIDER_MODULE = 'book_spider.spiders'
ROBOTSTXT_OBEY = True
| true | true |
1c124a644dce6828dad15c952e4d9e8b983a71d3 | 2,584 | py | Python | MaintenanceCodes/distance_final.py | CSCodeRep/Divgetbatch | 790155c097ff74a2803b8e40e20a9a6f2543e93e | [
"MIT"
] | null | null | null | MaintenanceCodes/distance_final.py | CSCodeRep/Divgetbatch | 790155c097ff74a2803b8e40e20a9a6f2543e93e | [
"MIT"
] | null | null | null | MaintenanceCodes/distance_final.py | CSCodeRep/Divgetbatch | 790155c097ff74a2803b8e40e20a9a6f2543e93e | [
"MIT"
] | null | null | null | from pyclustering.utils import euclidean_distance_square
import numpy as np
import timeit
import math
import crab as cr
def distance_euclidean(x, y):
m = len(x)
i = 0
d = 0
while(i < m):
tmp = x[i] - y[i]
i = i + 1
d += tmp * tmp
return d
x... | 21.355372 | 82 | 0.536765 | from pyclustering.utils import euclidean_distance_square
import numpy as np
import timeit
import math
import crab as cr
def distance_euclidean(x, y):
m = len(x)
i = 0
d = 0
while(i < m):
tmp = x[i] - y[i]
i = i + 1
d += tmp * tmp
return d
x... | true | true |
1c124ae1a4a5d33890a3d252032af1e928350b17 | 12,503 | py | Python | src/WebApp/flask/app.py | mohansswell/AI-PredictiveMaintenance | d5483550f57bcebc3e460b411a27daebe63d80f7 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | src/WebApp/flask/app.py | mohansswell/AI-PredictiveMaintenance | d5483550f57bcebc3e460b411a27daebe63d80f7 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | src/WebApp/flask/app.py | mohansswell/AI-PredictiveMaintenance | d5483550f57bcebc3e460b411a27daebe63d80f7 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | import numpy as np
import sys, os, time, glob
import requests
import json
import uuid
import json
import random
import markdown
import jwt
import io
import csv
import collections
from urllib.parse import urlparse
from datetime import datetime, timedelta
from functools import wraps
from flask import Flask, render_templa... | 32.559896 | 134 | 0.693434 | import numpy as np
import sys, os, time, glob
import requests
import json
import uuid
import json
import random
import markdown
import jwt
import io
import csv
import collections
from urllib.parse import urlparse
from datetime import datetime, timedelta
from functools import wraps
from flask import Flask, render_templa... | true | true |
1c124baa1c1fac663803b199b14cae09aa26d218 | 5,619 | py | Python | tests/parser/features/decorators/test_payable.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 1,347 | 2019-11-22T06:49:38.000Z | 2022-03-31T19:49:32.000Z | tests/parser/features/decorators/test_payable.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 915 | 2019-11-21T05:48:16.000Z | 2022-03-31T23:51:03.000Z | tests/parser/features/decorators/test_payable.py | upgradvisor/vyper | 642884ea938a25793c1b2fac866e8458e63a7b49 | [
"Apache-2.0"
] | 262 | 2019-11-28T01:44:04.000Z | 2022-03-31T21:33:43.000Z | import pytest
from vyper.exceptions import CallViolation
@pytest.mark.parametrize(
"source",
[
"""
interface PiggyBank:
def deposit(): nonpayable
piggy: PiggyBank
@external
def foo():
self.piggy.deposit()
""",
# You don't have to send value in a payable call
"""
interfac... | 14.984 | 93 | 0.62431 | import pytest
from vyper.exceptions import CallViolation
@pytest.mark.parametrize(
"source",
[
"""
interface PiggyBank:
def deposit(): nonpayable
piggy: PiggyBank
@external
def foo():
self.piggy.deposit()
""",
"""
interface PiggyBank:
def deposit(): payable
piggy: P... | true | true |
1c124c318c60691320c0d72dcf0402dc4b73f54b | 5,713 | py | Python | jiant/utils/tokenization_normalization.py | azagsam/jiant_slovene | cd7230319ebcd99d845c44baf4caa410bd9acc49 | [
"MIT"
] | null | null | null | jiant/utils/tokenization_normalization.py | azagsam/jiant_slovene | cd7230319ebcd99d845c44baf4caa410bd9acc49 | [
"MIT"
] | null | null | null | jiant/utils/tokenization_normalization.py | azagsam/jiant_slovene | cd7230319ebcd99d845c44baf4caa410bd9acc49 | [
"MIT"
] | 1 | 2021-06-08T07:30:15.000Z | 2021-06-08T07:30:15.000Z | """Tokenization normalization (to improve likelihood of good cross tokenization alignment).
This module provides helpers for normalizing space tokenization and target tokenizations to make
proper alignment of the tokenizations more likely.
Notes:
* Code is ported from https://github.com/nyu-mll/jiant/blob/master/... | 43.610687 | 100 | 0.73429 |
import re
import transformers
from typing import Sequence
from jiant.utils.testing import utils as test_utils
def normalize_tokenizations(
space_tokenization: Sequence[str],
target_tokenization: Sequence[str],
tokenizer: transformers.PreTrainedTokenizer,
):
if len(space_tokenization) == 0 or len(tar... | true | true |
1c124c74f7114f8fc2eeaaed245ff947ad4a39dd | 5,198 | py | Python | examples/docs_snippets/docs_snippets/concepts/solids_pipelines/unit_tests.py | Andrew-Crosby/dagster | e646625a687dc656bdd855d88b868de957b37b62 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/solids_pipelines/unit_tests.py | Andrew-Crosby/dagster | e646625a687dc656bdd855d88b868de957b37b62 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/solids_pipelines/unit_tests.py | Andrew-Crosby/dagster | e646625a687dc656bdd855d88b868de957b37b62 | [
"Apache-2.0"
] | null | null | null | from dagster import (
AssetMaterialization,
DagsterEventType,
ExpectationResult,
InputDefinition,
Output,
OutputDefinition,
PipelineExecutionResult,
SolidExecutionResult,
build_solid_context,
execute_pipeline,
execute_solid,
pipeline,
solid,
)
@solid(
input_defs... | 25.99 | 100 | 0.719508 | from dagster import (
AssetMaterialization,
DagsterEventType,
ExpectationResult,
InputDefinition,
Output,
OutputDefinition,
PipelineExecutionResult,
SolidExecutionResult,
build_solid_context,
execute_pipeline,
execute_solid,
pipeline,
solid,
)
@solid(
input_defs... | true | true |
1c124cc0ef431df1c006e375bdeea74994522d8b | 43,793 | py | Python | numpy/lib/polynomial.py | NGeorgescu/numpy | 593ef5fc5a02fbcd6eeb70a59684b3b21c9cc643 | [
"BSD-3-Clause"
] | 1 | 2020-11-28T18:54:00.000Z | 2020-11-28T18:54:00.000Z | numpy/lib/polynomial.py | NGeorgescu/numpy | 593ef5fc5a02fbcd6eeb70a59684b3b21c9cc643 | [
"BSD-3-Clause"
] | null | null | null | numpy/lib/polynomial.py | NGeorgescu/numpy | 593ef5fc5a02fbcd6eeb70a59684b3b21c9cc643 | [
"BSD-3-Clause"
] | null | null | null | """
Functions to operate on polynomials.
"""
__all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit', 'RankWarning']
import functools
import re
import warnings
import numpy.core.numeric as NX
from numpy.core import (isscalar, ... | 30.306574 | 80 | 0.582445 | __all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd',
'polysub', 'polymul', 'polydiv', 'polyval', 'poly1d',
'polyfit', 'RankWarning']
import functools
import re
import warnings
import numpy.core.numeric as NX
from numpy.core import (isscalar, abs, finfo, atleast_1d, hstack, dot, array,
... | true | true |
1c124ce776f927688e618e5996f8472cc4e2b9f0 | 605 | py | Python | zip.py | Eric-Dang/PythonTools | df18b2893775a2c4bcfb21a64d3db60990b86fc4 | [
"MIT"
] | null | null | null | zip.py | Eric-Dang/PythonTools | df18b2893775a2c4bcfb21a64d3db60990b86fc4 | [
"MIT"
] | null | null | null | zip.py | Eric-Dang/PythonTools | df18b2893775a2c4bcfb21a64d3db60990b86fc4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os,re, shutil, zipfile
import MoveOut as MvOut
zipFileName = "./appConfig.zip".decode('utf8').encode('GBK')
ftpPath = "沙鹰/Out"
def zip_dir():
zf = zipfile.ZipFile(zipFileName, "w", zipfile.zlib.DEFLATED)
for root, dirs, files in os.walk(r"./out"):
for f in files:
fullpath = os.pa... | 24.2 | 62 | 0.666116 | import os,re, shutil, zipfile
import MoveOut as MvOut
zipFileName = "./appConfig.zip".decode('utf8').encode('GBK')
ftpPath = "沙鹰/Out"
def zip_dir():
zf = zipfile.ZipFile(zipFileName, "w", zipfile.zlib.DEFLATED)
for root, dirs, files in os.walk(r"./out"):
for f in files:
fullpath = os.path.join(root, f)
arna... | true | true |
1c124f42981c364430523ad24d7c2c494ed5bf56 | 1,486 | py | Python | ensemble.py | coded5282/youtube-8m | 888354ff1b20de529e3270f4eeec320e692de935 | [
"Apache-2.0"
] | 2 | 2017-04-29T17:30:04.000Z | 2019-04-20T08:38:40.000Z | ensemble.py | coded5282/youtube-8m | 888354ff1b20de529e3270f4eeec320e692de935 | [
"Apache-2.0"
] | null | null | null | ensemble.py | coded5282/youtube-8m | 888354ff1b20de529e3270f4eeec320e692de935 | [
"Apache-2.0"
] | null | null | null | # Ensemble submission csv files together
import numpy as np
import pandas as pd
import itertools
fns = [ # files for ensembling
"lstm.csv"
"moe4_do.csv"
]
fn0, fn1 = fns # getting each file to variable
outfn="weighted_predictions.csv" # output file
def parse_line(ln):
id_, vals = ln.strip().split(',') # spli... | 31.617021 | 92 | 0.629879 |
import numpy as np
import pandas as pd
import itertools
fns = [ "lstm.csv"
"moe4_do.csv"
]
fn0, fn1 = fns
outfn="weighted_predictions.csv"
def parse_line(ln):
id_, vals = ln.strip().split(',') vals = vals.split() ix = np.array(vals[::2]).astype(np.int16) p = np.array(vals[1::2]).astype(np.float32) df... | true | true |
1c124fd8e56ee2b8dc036a240e7d482e426006ba | 24,980 | py | Python | sqpdfo/minq.py | DLR-SC/sqpdfo | ae3213764fdd8d0d0a05bcc3d13be63d811a0a37 | [
"BSD-3-Clause"
] | 10 | 2020-03-03T21:56:01.000Z | 2022-03-29T08:36:01.000Z | sqpdfo/minq.py | DLR-SC/sqpdfo | ae3213764fdd8d0d0a05bcc3d13be63d811a0a37 | [
"BSD-3-Clause"
] | 6 | 2020-03-03T22:02:41.000Z | 2021-11-18T12:31:00.000Z | sqpdfo/minq.py | DLR-SC/sqpdfo | ae3213764fdd8d0d0a05bcc3d13be63d811a0a37 | [
"BSD-3-Clause"
] | 3 | 2021-02-17T14:43:30.000Z | 2022-03-05T08:46:48.000Z | """
Minimizes an affine quadratic form subject to simple bounds,
using coordinate searches and reduced subspace minimizations
using LDL^T factorization updates
min fval = gamma + c^T x + 0.5 x^T G x }
s.t. x in [xu,xo]
where G is a symmetric (n x n) matrix, not necessarily definite
(if G... | 32.610966 | 112 | 0.427142 |
__docformat__ = "restructuredtext en"
import numpy
from sqpdfo.minq_util import toRow, toCol, find, mldiv, crdot
eps = numpy.finfo('d').eps
inf = numpy.inf
class Minq:
convex = 0
nitrefmax = 3
neps = 100*eps
nsub = 0
... | true | true |
1c125098ee534928f6963b189f8a92385e214cf6 | 990 | py | Python | DataSymphony/external/processors.py | benstindavis/mtx-data-symphony | 745eb5cd5070fe7b329622d73faa54010c37a551 | [
"MIT"
] | null | null | null | DataSymphony/external/processors.py | benstindavis/mtx-data-symphony | 745eb5cd5070fe7b329622d73faa54010c37a551 | [
"MIT"
] | null | null | null | DataSymphony/external/processors.py | benstindavis/mtx-data-symphony | 745eb5cd5070fe7b329622d73faa54010c37a551 | [
"MIT"
] | null | null | null | import cv2 as cv
import numpy as np
class videoProcessor:
def __init__(self,pathToVideo):
FINAL_SIZE = (224,224)
FINAL_FPS = 15
self.pathToOutputVideo = f"{pathToVideo.split('.mp4')[0]}_output.mp4"
cap = cv.VideoCapture(pathToVideo)
fourcc = cv.VideoWriter_fourcc(*'mp4v')... | 24.146341 | 93 | 0.523232 | import cv2 as cv
import numpy as np
class videoProcessor:
def __init__(self,pathToVideo):
FINAL_SIZE = (224,224)
FINAL_FPS = 15
self.pathToOutputVideo = f"{pathToVideo.split('.mp4')[0]}_output.mp4"
cap = cv.VideoCapture(pathToVideo)
fourcc = cv.VideoWriter_fourcc(*'mp4v')... | true | true |
1c12517f197b78aaf661514faa967fa702913e50 | 10,176 | py | Python | contrib/spendfrom/spendfrom.py | vlockchain/FTP | 5754ceec86cc00dbf0c24505a196838f63eccdf3 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | vlockchain/FTP | 5754ceec86cc00dbf0c24505a196838f63eccdf3 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | vlockchain/FTP | 5754ceec86cc00dbf0c24505a196838f63eccdf3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend phrs received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a fictecpagosd or fic... | 37.970149 | 111 | 0.637677 |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis... | true | true |
1c12521fa26dbae1b9e40cb193a2feb7370a57d7 | 156 | py | Python | .torch_deep_alexnet (not prepared)/_src/types.py | AccessibleAI/ailibrary | f283f7c1608f5998694efc3cdbd0a29ebf3239c2 | [
"Apache-2.0"
] | 5 | 2020-11-09T21:50:10.000Z | 2021-07-09T00:22:16.000Z | .torch_deep_alexnet (not prepared)/_src/types.py | AccessibleAI/ailibrary | f283f7c1608f5998694efc3cdbd0a29ebf3239c2 | [
"Apache-2.0"
] | 14 | 2019-12-03T06:08:07.000Z | 2021-11-21T11:56:13.000Z | .torch_deep_alexnet (not prepared)/_src/types.py | AccessibleAI/ailibrary | f283f7c1608f5998694efc3cdbd0a29ebf3239c2 | [
"Apache-2.0"
] | 2 | 2020-01-07T15:35:43.000Z | 2021-08-19T15:41:16.000Z | """
All rights reserved to cnvrg.io
http://www.cnvrg.io
types.py
==============================================================================
"""
| 15.6 | 78 | 0.301282 | true | true | |
1c1252ab8c6bee4154550eec95f737957bb1e901 | 8,951 | py | Python | cdk-project/lib/images/codebuild-image/python/src/notebooks/dictionary.py | ahsan-z-khan/sagemaker-example-notebooks-testing | d2be59bb74656cc207b18acf95edd8846ef5e687 | [
"Apache-2.0"
] | 9 | 2021-04-26T22:37:28.000Z | 2021-12-16T02:04:48.000Z | cdk-project/lib/images/codebuild-image/python/src/notebooks/dictionary.py | ahsan-z-khan/sagemaker-example-notebooks-testing | d2be59bb74656cc207b18acf95edd8846ef5e687 | [
"Apache-2.0"
] | 4 | 2021-06-24T21:44:24.000Z | 2021-09-26T22:48:35.000Z | cdk-project/lib/images/codebuild-image/python/src/notebooks/dictionary.py | ahsan-z-khan/sagemaker-example-notebooks-testing | d2be59bb74656cc207b18acf95edd8846ef5e687 | [
"Apache-2.0"
] | 16 | 2021-05-20T16:26:21.000Z | 2021-11-01T08:46:29.000Z | allow_list = {
"Alexa",
"Amazon",
"AWS",
"aws",
"Amplify",
"API",
"Gateway",
"App" "AppFlow",
"AppStream",
"AppSync",
"ARN",
"arn",
"Athena",
"A2I",
"Aurora",
"Backint",
"Blockchain",
"Blox",
"BYOC",
"ACM",
"Chatbot",
"VPN",
"CD... | 18.844211 | 39 | 0.578148 | allow_list = {
"Alexa",
"Amazon",
"AWS",
"aws",
"Amplify",
"API",
"Gateway",
"App" "AppFlow",
"AppStream",
"AppSync",
"ARN",
"arn",
"Athena",
"A2I",
"Aurora",
"Backint",
"Blockchain",
"Blox",
"BYOC",
"ACM",
"Chatbot",
"VPN",
"CD... | true | true |
1c125409bf4950feb46c618f803af0fafa66730a | 7,821 | py | Python | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_5GHzSetRadioTransmitPower.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_5GHzSetRadioTransmitPower.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/WIFIHAL/TS_WIFIHAL_5GHzSetRadioTransmitPower.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2018 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 40.314433 | 157 | 0.732131 | # file the following copyright and licenses apply:
#
# Copyright 2018 RDK Management
#
# 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 ... | false | true |
1c1254506d4783c027ee700c158eff126d8b65bf | 162 | py | Python | chaptermarkers/__init__.py | cbitterfield/chaptermarkers | 1d5058bb83101b86ad08aa04ef5d1fd75117d364 | [
"MIT"
] | 1 | 2022-02-02T17:52:31.000Z | 2022-02-02T17:52:31.000Z | chaptermarkers/__init__.py | cbitterfield/chaptermarkers | 1d5058bb83101b86ad08aa04ef5d1fd75117d364 | [
"MIT"
] | 1 | 2021-07-27T21:29:02.000Z | 2021-07-27T21:29:02.000Z | chaptermarkers/__init__.py | cbitterfield/chaptermarkers | 1d5058bb83101b86ad08aa04ef5d1fd75117d364 | [
"MIT"
] | 1 | 2022-03-03T12:57:54.000Z | 2022-03-03T12:57:54.000Z | # -*- coding: utf-8 -*-
"""Top-level package for chaptermarkers."""
__author__ = 'Colin Bitterfield'
__email__ = 'cbitterfield@gmail.com'
__version__ = '1.2.8'
| 20.25 | 43 | 0.685185 |
__author__ = 'Colin Bitterfield'
__email__ = 'cbitterfield@gmail.com'
__version__ = '1.2.8'
| true | true |
1c1254750458a5600bf3050d916e0cc4157ffed1 | 1,732 | py | Python | profess/Test/test.py | garagonc/simulation-engine | c129f0bf601e0d56d924c9e5fa2cf94f7e31a356 | [
"Apache-2.0"
] | 3 | 2019-06-24T09:02:21.000Z | 2020-01-30T10:37:46.000Z | profess/Test/test.py | linksmart/simulation-engine | c129f0bf601e0d56d924c9e5fa2cf94f7e31a356 | [
"Apache-2.0"
] | null | null | null | profess/Test/test.py | linksmart/simulation-engine | c129f0bf601e0d56d924c9e5fa2cf94f7e31a356 | [
"Apache-2.0"
] | null | null | null | from profess.Profess import *
from profess.JSONparser import *
import json
#domain = "http://localhost:8080/v1/"
domain = "http://192.168.99.100:8080/v1/"
#dummyInputData = open('inputData.json').read()
#jsonInputDataFile=json.loads(dummyInputData)
IEEE13=open("furTopology.json").read()
jsonIEEE = json.loads(IEEE13)
... | 31.490909 | 151 | 0.69515 | from profess.Profess import *
from profess.JSONparser import *
import json
domain = "http://192.168.99.100:8080/v1/"
IEEE13=open("furTopology.json").read()
jsonIEEE = json.loads(IEEE13)
modelDataFile = open('model.json').read()
p1 = Profess("http://localhost:8080/v1/",topology=jsonIEEE)
dummyprofile= [3] * 24
dummy... | true | true |
1c1254da3f955a49e1c9f8bb62a94b25489155c2 | 5,476 | py | Python | singlenet-function/dataset/label_maps.py | gjbang/graduation-design | deaaa11ed652ac0b8843a039f04665da67181566 | [
"Apache-2.0"
] | null | null | null | singlenet-function/dataset/label_maps.py | gjbang/graduation-design | deaaa11ed652ac0b8843a039f04665da67181566 | [
"Apache-2.0"
] | null | null | null | singlenet-function/dataset/label_maps.py | gjbang/graduation-design | deaaa11ed652ac0b8843a039f04665da67181566 | [
"Apache-2.0"
] | 1 | 2021-06-24T15:28:20.000Z | 2021-06-24T15:28:20.000Z | import math
import numpy as np
# from dataset.base_dataflow import JointsLoader
from dataset.base_dataflow import JointsLoader
# values of params in order:
# [19, 28, 28, list, 5, 8]
# height * stride == 224 -> image input size
# joints' range is over than 224, so they are the original coordinates of coco images
d... | 37.765517 | 112 | 0.614134 | import math
import numpy as np
from dataset.base_dataflow import JointsLoader
def create_heatmap(num_maps, height, width, all_joints, sigma, stride):
heatmap = np.zeros((height, width, num_maps), dtype=np.float32)
# print("[DEBUG] create heatmap: sigma: %s, stride: %s, height: %s, width: %s" %(sigma,strid... | true | true |
1c125636769a4ad6f3b17da090a3a6e4f47b5530 | 95 | py | Python | pattern1.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | pattern1.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | pattern1.py | bjoffficial/Python | 73e6fdc19a1bec18488405c4a60c30ba68581ce5 | [
"Apache-2.0"
] | null | null | null | for i in range(5):
for j in range(i+1):
print("*",end=' ')
print("\r")
| 19 | 27 | 0.410526 | for i in range(5):
for j in range(i+1):
print("*",end=' ')
print("\r")
| true | true |
1c12566e5c89f0904ca4351a3c4fb2aec188ee79 | 1,298 | py | Python | generate_black.py | zigonk/CMPC-Refseg | 0d59c90e9968ed836c695976ff90081e1c24378a | [
"MIT"
] | null | null | null | generate_black.py | zigonk/CMPC-Refseg | 0d59c90e9968ed836c695976ff90081e1c24378a | [
"MIT"
] | null | null | null | generate_black.py | zigonk/CMPC-Refseg | 0d59c90e9968ed836c695976ff90081e1c24378a | [
"MIT"
] | null | null | null | import numpy as np
import os
import json
import cv2
cfg = {
"meta": "/mnt/MyPassport/Youtube-VOS/meta_expressions/meta_expressions/valid/meta_expressions.json",
"visdir": "./Annotations_1channel",
}
black_img = np.zeros((720, 1280)).astype(np.uint8)
cnt = 0
meta_expression = {}
with open(cfg['meta']) as me... | 34.157895 | 123 | 0.641757 | import numpy as np
import os
import json
import cv2
cfg = {
"meta": "/mnt/MyPassport/Youtube-VOS/meta_expressions/meta_expressions/valid/meta_expressions.json",
"visdir": "./Annotations_1channel",
}
black_img = np.zeros((720, 1280)).astype(np.uint8)
cnt = 0
meta_expression = {}
with open(cfg['meta']) as me... | true | true |
1c125740fae07dd59aa13c3a0bb6dc8113072307 | 16,921 | py | Python | roundup/github.py | zware/bpo-roundup | 68573d196f9a01786414d3b235252b9c857c3e08 | [
"MIT"
] | null | null | null | roundup/github.py | zware/bpo-roundup | 68573d196f9a01786414d3b235252b9c857c3e08 | [
"MIT"
] | null | null | null | roundup/github.py | zware/bpo-roundup | 68573d196f9a01786414d3b235252b9c857c3e08 | [
"MIT"
] | null | null | null | import hashlib
import hmac
import json
import re
import os
import logging
from roundup.date import Date
from roundup.exceptions import Unauthorised, MethodNotAllowed, \
UnsupportedMediaType, Reject
if hasattr(hmac, 'compare_digest'):
compare_digest = hmac.compare_digest
else:
def compare_digest(a, b):
... | 36.864924 | 90 | 0.575852 | import hashlib
import hmac
import json
import re
import os
import logging
from roundup.date import Date
from roundup.exceptions import Unauthorised, MethodNotAllowed, \
UnsupportedMediaType, Reject
if hasattr(hmac, 'compare_digest'):
compare_digest = hmac.compare_digest
else:
def compare_digest(a, b):
... | true | true |
1c1258c3a023b53d8524b6d1ace73a54c70119d8 | 97 | py | Python | services/service-pick&drop/run.py | Beracah-Group/docker-microservices | 2876b05ba585772e97746a11845b64bd4ede61cb | [
"MIT"
] | 1 | 2020-02-18T08:52:02.000Z | 2020-02-18T08:52:02.000Z | services/service-pick&drop/run.py | Beracah-Group/docker-microservices | 2876b05ba585772e97746a11845b64bd4ede61cb | [
"MIT"
] | null | null | null | services/service-pick&drop/run.py | Beracah-Group/docker-microservices | 2876b05ba585772e97746a11845b64bd4ede61cb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from src.api.__init__ import app
if __name__ == '__main__':
app.run() | 19.4 | 32 | 0.690722 | from src.api.__init__ import app
if __name__ == '__main__':
app.run() | true | true |
1c125aa39e14758b84d3333aaee5fe0eee433733 | 56,336 | py | Python | pyNastran/bdf/cards/test/test_loads.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/cards/test/test_loads.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/cards/test/test_loads.py | jtran10/pyNastran | 4aed8e05b91576c2b50ee835f0497a9aad1d2cb0 | [
"BSD-3-Clause"
] | null | null | null | """
tests static load cards
"""
from __future__ import print_function
import os
import unittest
import numpy as np
from numpy import array, allclose, array_equal, set_printoptions
set_printoptions(suppress=True, precision=3)
import pyNastran
from pyNastran.bdf.bdf import BDF, BDFCard, DAREA, PLOAD4, read_bdf, RROD
fro... | 43.268817 | 151 | 0.510313 | from __future__ import print_function
import os
import unittest
import numpy as np
from numpy import array, allclose, array_equal, set_printoptions
set_printoptions(suppress=True, precision=3)
import pyNastran
from pyNastran.bdf.bdf import BDF, BDFCard, DAREA, PLOAD4, read_bdf, RROD
from pyNastran.bdf.cards.base_card ... | true | true |
1c125ae01476cc97ae7b6989ddded4fbfe64e0e4 | 156 | py | Python | siqbal/hook_events/journal_entry.py | smehata/siqbal | 8b6a21fb63c050237593c49757065198c0e2c54a | [
"MIT"
] | null | null | null | siqbal/hook_events/journal_entry.py | smehata/siqbal | 8b6a21fb63c050237593c49757065198c0e2c54a | [
"MIT"
] | null | null | null | siqbal/hook_events/journal_entry.py | smehata/siqbal | 8b6a21fb63c050237593c49757065198c0e2c54a | [
"MIT"
] | 2 | 2021-12-27T06:55:00.000Z | 2022-01-31T12:39:07.000Z | # def set_name(je, method):
# naming_series = {"SIqbal Tiles": "TC-JV-"}
# name = naming_series.get(je.company) + je.name.split("-")[2]
# je.name = name
| 31.2 | 63 | 0.628205 | true | true | |
1c125b97c326efbbcb9b3d56ae3b31bb608fc166 | 4,518 | py | Python | datable/web/widgets.py | ofirr/dojango-datable | c4d27c23d66c023062270a31f05e21d0982e0b43 | [
"MIT"
] | null | null | null | datable/web/widgets.py | ofirr/dojango-datable | c4d27c23d66c023062270a31f05e21d0982e0b43 | [
"MIT"
] | null | null | null | datable/web/widgets.py | ofirr/dojango-datable | c4d27c23d66c023062270a31f05e21d0982e0b43 | [
"MIT"
] | null | null | null | """Widgets are used to perform filtering.
"""
from django.utils.text import capfirst
from datable.core.converters import BooleanConverter
from datable.core.converters import DateValueConverter
from datable.core.converters import DateTimeValueConverter
from datable.core.converters import StringValueConverter
from dat... | 28.594937 | 74 | 0.646746 |
from django.utils.text import capfirst
from datable.core.converters import BooleanConverter
from datable.core.converters import DateValueConverter
from datable.core.converters import DateTimeValueConverter
from datable.core.converters import StringValueConverter
from datable.core.filters import BooleanFilter
from da... | true | true |
1c125bfc5160f85532d833c98ef9fa8fb0ce9858 | 1,152 | py | Python | jira_commands/cli/list.py | unixorn/jira-commands | 21bcb209730c2873e719a316788233e5a3658198 | [
"Apache-2.0"
] | 15 | 2022-02-15T16:07:54.000Z | 2022-03-15T03:42:18.000Z | jira_commands/cli/list.py | unixorn/jira-commands | 21bcb209730c2873e719a316788233e5a3658198 | [
"Apache-2.0"
] | 4 | 2022-03-01T02:37:23.000Z | 2022-03-11T22:42:21.000Z | jira_commands/cli/list.py | unixorn/jira-commands | 21bcb209730c2873e719a316788233e5a3658198 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# interact with jira
#
# Author: Joe Block <jblock@zscaler.com>
# License: Apache 2.0
# Copyright 2022, ZScaler Inc.
import logging
from jira_commands.cli.common import baseCLIParser
from jira_commands.jira import JiraTool, loadJiraSettings
def parseListCLI():
"""
Parse the command ... | 25.043478 | 104 | 0.688368 |
import logging
from jira_commands.cli.common import baseCLIParser
from jira_commands.jira import JiraTool, loadJiraSettings
def parseListCLI():
parser = baseCLIParser(description="List JIRA tickets in a project")
parser.add_argument("--project", "-p", type=str, default="SYSENG")
cliArgs = parser.parse... | true | true |
1c125d40dcb05c657ed44db08906f2a54fa86122 | 494 | py | Python | tests/settings.py | andrewyoung1991/django-redis-pubsub | 6ec9467528919a20bc9db6ebe94d5929ddd028a6 | [
"BSD-3-Clause"
] | 21 | 2016-02-11T06:04:48.000Z | 2021-12-27T07:02:28.000Z | tests/settings.py | kashyap2108/django-redis-pubsub | 6ec9467528919a20bc9db6ebe94d5929ddd028a6 | [
"BSD-3-Clause"
] | 3 | 2020-05-17T13:53:50.000Z | 2021-06-10T20:38:34.000Z | tests/settings.py | kashyap2108/django-redis-pubsub | 6ec9467528919a20bc9db6ebe94d5929ddd028a6 | [
"BSD-3-Clause"
] | 8 | 2016-02-05T20:17:43.000Z | 2020-07-14T17:10:20.000Z | DEBUG = True
SECRET_KEY = "unguessable"
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sites",
"rest_framework.authtoken",
"redis_pubsub",
"testapp"
]
DATABASES = {
"default": {
... | 18.296296 | 59 | 0.609312 | DEBUG = True
SECRET_KEY = "unguessable"
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sites",
"rest_framework.authtoken",
"redis_pubsub",
"testapp"
]
DATABASES = {
"default": {
... | true | true |
1c125edbadec2c3779660749136c52e57997d09f | 556 | py | Python | Day 1/day1-final-project.py | vmprk/100-Days-of-Code---The-Complete-Python-Pro-Bootcamp | cc9a9a71e4ac62ce6eda3eaae13b1d22611fd085 | [
"MIT"
] | null | null | null | Day 1/day1-final-project.py | vmprk/100-Days-of-Code---The-Complete-Python-Pro-Bootcamp | cc9a9a71e4ac62ce6eda3eaae13b1d22611fd085 | [
"MIT"
] | null | null | null | Day 1/day1-final-project.py | vmprk/100-Days-of-Code---The-Complete-Python-Pro-Bootcamp | cc9a9a71e4ac62ce6eda3eaae13b1d22611fd085 | [
"MIT"
] | null | null | null | #1. Create a greeting for your program.
print("Hello! Welcome to the Band Name Generator.")
#2. Ask the user for the city that they grew up in.
city = input("Which city did you grew up in?\n")
#3. Ask the user for the name of a pet.
pet = input("What's the name of your pet?\n")
#4. Combine the name of their city and p... | 42.769231 | 73 | 0.71223 | print("Hello! Welcome to the Band Name Generator.")
city = input("Which city did you grew up in?\n")
pet = input("What's the name of your pet?\n")
#4. Combine the name of their city and pet and show them their band name.
Band_Name = city + " " + pet
#5. Make sure the input cursor shows on a new line, see the example ... | true | true |
1c125fdaba470c6b35d9cc3196fb9739a6f81140 | 49 | py | Python | src/nostradamus/unit_test/__init__.py | Orlogskapten/tsNostradamus | 707cbc23fac3e0f92875d89550046e5c3b7b17d2 | [
"MIT"
] | 3 | 2020-07-06T10:58:40.000Z | 2020-07-23T21:39:51.000Z | src/nostradamus/unit_test/__init__.py | wenceslas-sanchez/tsNostradamus | 707cbc23fac3e0f92875d89550046e5c3b7b17d2 | [
"MIT"
] | null | null | null | src/nostradamus/unit_test/__init__.py | wenceslas-sanchez/tsNostradamus | 707cbc23fac3e0f92875d89550046e5c3b7b17d2 | [
"MIT"
] | null | null | null | from .test_tunnel_snake import test_fit_transform | 49 | 49 | 0.918367 | from .test_tunnel_snake import test_fit_transform | true | true |
1c12619bc50fbc0b83b6eceaa00125bac385be83 | 22 | py | Python | src/__init__.py | ska-telescope/ska-tango-bacnet-ds | 5a219413f63b00ecdbf95060f9667e457d17d287 | [
"BSD-3-Clause"
] | null | null | null | src/__init__.py | ska-telescope/ska-tango-bacnet-ds | 5a219413f63b00ecdbf95060f9667e457d17d287 | [
"BSD-3-Clause"
] | null | null | null | src/__init__.py | ska-telescope/ska-tango-bacnet-ds | 5a219413f63b00ecdbf95060f9667e457d17d287 | [
"BSD-3-Clause"
] | null | null | null | __all__ = ['BACnetDS'] | 22 | 22 | 0.681818 | __all__ = ['BACnetDS'] | true | true |
1c1261bfb6394eda727d96916ecb0916aadabe0d | 764 | py | Python | var/spack/repos/builtin/packages/zookeeper-benchmark/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/zookeeper-benchmark/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/zookeeper-benchmark/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class ZookeeperBenchmark(MavenPackage):
"""It is designed to measure the per-request latency of a ZooKeeper
ensem... | 34.727273 | 73 | 0.700262 |
class ZookeeperBenchmark(MavenPackage):
homepage = "http://zookeeper.apache.org"
git = "https://github.com/brownsys/zookeeper-benchmark.git"
version('master', branch='master')
depends_on('zookeeper', type=('build', 'run'))
def build(self, spec, prefix):
zookeeper_version = self.sp... | true | true |
1c126252b354847d883577ea20f1dcb3a08803b5 | 12,402 | py | Python | lib/datasets/pascal_voc.py | zergmk2/tf_ctpn | f0f20606b3a2e58819cb330ede52b1d9e2c21d31 | [
"MIT"
] | 39 | 2018-06-14T01:14:34.000Z | 2021-11-21T22:03:12.000Z | lib/datasets/pascal_voc.py | zergmk2/tf_ctpn | f0f20606b3a2e58819cb330ede52b1d9e2c21d31 | [
"MIT"
] | 9 | 2018-08-07T03:36:47.000Z | 2020-05-07T10:17:41.000Z | lib/datasets/pascal_voc.py | zergmk2/tf_ctpn | f0f20606b3a2e58819cb330ede52b1d9e2c21d31 | [
"MIT"
] | 16 | 2018-07-14T15:02:31.000Z | 2022-01-06T08:57:01.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ i... | 39.623003 | 89 | 0.543058 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from datasets.imdb import imdb
import datasets.ds_utils as ds_utils
import xml.etree.ElementTree as ET
import numpy as np
import scipy.sparse
import scipy.io as sio
import utils.cython_bbox
import pic... | true | true |
1c126287c3216e86420adc1afc9df6e955fc094f | 603 | py | Python | doc/examples/bench_time_func.py | Tada-Project/pyperf | 0a0b68582b3eb1ba221cd15eabe5e965e7f28338 | [
"MIT"
] | 225 | 2020-05-07T23:06:35.000Z | 2022-03-29T02:52:07.000Z | doc/examples/bench_time_func.py | Tada-Project/pyperf | 0a0b68582b3eb1ba221cd15eabe5e965e7f28338 | [
"MIT"
] | 43 | 2020-05-07T21:28:01.000Z | 2022-03-18T10:43:35.000Z | doc/examples/bench_time_func.py | Tada-Project/pyperf | 0a0b68582b3eb1ba221cd15eabe5e965e7f28338 | [
"MIT"
] | 25 | 2020-05-07T21:06:59.000Z | 2022-03-15T22:04:53.000Z | #!/usr/bin/env python3
import pyperf
def bench_dict(loops, mydict):
range_it = range(loops)
t0 = pyperf.perf_counter()
for loops in range_it:
mydict['0']
mydict['100']
mydict['200']
mydict['300']
mydict['400']
mydict['500']
mydict['600']
myd... | 21.535714 | 71 | 0.595357 | import pyperf
def bench_dict(loops, mydict):
range_it = range(loops)
t0 = pyperf.perf_counter()
for loops in range_it:
mydict['0']
mydict['100']
mydict['200']
mydict['300']
mydict['400']
mydict['500']
mydict['600']
mydict['700']
mydi... | true | true |
1c1263b78dfc86008e3c2e491ec7fda957b70c97 | 370 | py | Python | exercicios/desafio18.py | grimario-andre/Python | c1e3a7cb60a9c4fce9e650b449bf0d555c0fb59a | [
"MIT"
] | null | null | null | exercicios/desafio18.py | grimario-andre/Python | c1e3a7cb60a9c4fce9e650b449bf0d555c0fb59a | [
"MIT"
] | null | null | null | exercicios/desafio18.py | grimario-andre/Python | c1e3a7cb60a9c4fce9e650b449bf0d555c0fb59a | [
"MIT"
] | null | null | null | print('======================= Exibir Cos,Sen e Tan ======================')
angulo = int(input('Informe o valor do angulo '))
from math import cos,tan,sin,radians
rad = radians(angulo)
coss = cos(rad)
seno = sin(rad)
tang = tan(rad)
print('O angulo escolhido {}, terá os valores de cosseno {:.2f}, seno {:.2f} e tange... | 33.636364 | 96 | 0.589189 | print('======================= Exibir Cos,Sen e Tan ======================')
angulo = int(input('Informe o valor do angulo '))
from math import cos,tan,sin,radians
rad = radians(angulo)
coss = cos(rad)
seno = sin(rad)
tang = tan(rad)
print('O angulo escolhido {}, terá os valores de cosseno {:.2f}, seno {:.2f} e tange... | true | true |
1c12650d20fae455336538a375173c26f8b50160 | 960 | py | Python | install_grc.py | GassiusODude/gr-gen-tools | 77b22c10c8cc7dfb383556f322bc7ebca5a94efe | [
"MIT"
] | null | null | null | install_grc.py | GassiusODude/gr-gen-tools | 77b22c10c8cc7dfb383556f322bc7ebca5a94efe | [
"MIT"
] | 2 | 2020-08-30T19:37:11.000Z | 2020-08-30T19:37:48.000Z | install_grc.py | GassiusODude/gr-gen-tools | 77b22c10c8cc7dfb383556f322bc7ebca5a94efe | [
"MIT"
] | null | null | null | import os
from argparse import ArgumentParser
def install_grc(c_dir, recur=True):
files = os.listdir(c_dir)
for c_file in files:
if os.path.isdir(c_dir + "/" + c_file):
# if directory check if we recursively find grc files
if recur:
install_grc(c_dir + "/... | 33.103448 | 65 | 0.565625 | import os
from argparse import ArgumentParser
def install_grc(c_dir, recur=True):
files = os.listdir(c_dir)
for c_file in files:
if os.path.isdir(c_dir + "/" + c_file):
if recur:
install_grc(c_dir + "/" + c_file)
else:
if c_file[-4:] ... | true | true |
1c126562cd64312851d8b3487f3524b5e1d3bf09 | 4,432 | py | Python | IntelliTable/main/forms.py | AllStars101-sudo/Intellitable | 6901dbb9a74c04d89c7ed074f50c0128daac7211 | [
"Apache-2.0"
] | null | null | null | IntelliTable/main/forms.py | AllStars101-sudo/Intellitable | 6901dbb9a74c04d89c7ed074f50c0128daac7211 | [
"Apache-2.0"
] | null | null | null | IntelliTable/main/forms.py | AllStars101-sudo/Intellitable | 6901dbb9a74c04d89c7ed074f50c0128daac7211 | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class NewUserForm(UserCreationForm):
email = forms.EmailField(required=True)
class Meta:
model = User
fields = ("username", "email", "password1", "password2")
... | 86.901961 | 132 | 0.732626 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class NewUserForm(UserCreationForm):
email = forms.EmailField(required=True)
class Meta:
model = User
fields = ("username", "email", "password1", "password2")
... | true | true |
1c1265a114cafa596f9a3948d48628bd6e866f34 | 3,332 | py | Python | mkdocs_minify_plugin/plugin.py | ktomk/mkdocs-minify-plugin | 99232ddddcbb891e10804175e29630e7086fcf24 | [
"MIT"
] | null | null | null | mkdocs_minify_plugin/plugin.py | ktomk/mkdocs-minify-plugin | 99232ddddcbb891e10804175e29630e7086fcf24 | [
"MIT"
] | null | null | null | mkdocs_minify_plugin/plugin.py | ktomk/mkdocs-minify-plugin | 99232ddddcbb891e10804175e29630e7086fcf24 | [
"MIT"
] | null | null | null | import os
import sys
import fnmatch
from timeit import default_timer as timer
from datetime import datetime, timedelta
from mkdocs import utils as mkdocs_utils
from mkdocs.config import config_options, Config
from mkdocs.plugins import BasePlugin
import mkdocs.structure.files
from jsmin import jsmin
from htmlmin impo... | 47.6 | 437 | 0.611044 | import os
import sys
import fnmatch
from timeit import default_timer as timer
from datetime import datetime, timedelta
from mkdocs import utils as mkdocs_utils
from mkdocs.config import config_options, Config
from mkdocs.plugins import BasePlugin
import mkdocs.structure.files
from jsmin import jsmin
from htmlmin impo... | true | true |
1c12691b0c6341614776884a33c3394f0a7870a7 | 451 | py | Python | ammarit/it/migrations/0015_item_ownership_desc.py | aammar/IT-Storage-Ticket-System | 6b8fb7a915cdd10e7a003301a35477a718129643 | [
"Apache-2.0"
] | null | null | null | ammarit/it/migrations/0015_item_ownership_desc.py | aammar/IT-Storage-Ticket-System | 6b8fb7a915cdd10e7a003301a35477a718129643 | [
"Apache-2.0"
] | null | null | null | ammarit/it/migrations/0015_item_ownership_desc.py | aammar/IT-Storage-Ticket-System | 6b8fb7a915cdd10e7a003301a35477a718129643 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('it', '0014_auto_20160823_1631'),
]
operations = [
migrations.AddField(
model_name='item',
name='owne... | 21.47619 | 64 | 0.603104 | from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('it', '0014_auto_20160823_1631'),
]
operations = [
migrations.AddField(
model_name='item',
name='ownership_desc',
... | true | true |
1c12693ebb45529dc410f399760df3aebefc64dc | 269 | py | Python | src/url/requests/hook_response.py | snowdreams1006/learn-python | d224bedbb670b6462e1e9a013c0a0316be10207c | [
"MIT"
] | 1 | 2019-12-25T04:20:19.000Z | 2019-12-25T04:20:19.000Z | src/url/requests/hook_response.py | snowdreams1006/learn-python | d224bedbb670b6462e1e9a013c0a0316be10207c | [
"MIT"
] | 13 | 2020-01-16T03:23:50.000Z | 2020-11-25T11:55:29.000Z | src/url/requests/hook_response.py | snowdreams1006/learn-python | d224bedbb670b6462e1e9a013c0a0316be10207c | [
"MIT"
] | 1 | 2020-03-28T11:46:03.000Z | 2020-03-28T11:46:03.000Z | # -*- coding: utf-8 -*-
import requests
def get_key_info(response, *args, **kwargs):
"""回调函数
"""
print response.headers['Content-Type']
def main():
"""主程序
"""
requests.get('https://api.github.com', hooks=dict(response=get_key_info))
main()
| 15.823529 | 77 | 0.605948 | import requests
def get_key_info(response, *args, **kwargs):
"""回调函数
"""
print response.headers['Content-Type']
def main():
"""主程序
"""
requests.get('https://api.github.com', hooks=dict(response=get_key_info))
main()
| false | true |
1c12694458ce5ab23c32b3ba6879761dd8b8ee60 | 3,161 | py | Python | uberNow/apps/apicalls/mongodb_api.py | anirbanroydas/uberNow | 562a15b9dd82aa32c92992e33d295f1eef67516b | [
"MIT"
] | 3 | 2018-03-12T07:53:52.000Z | 2021-07-26T11:32:25.000Z | uberNow/apps/apicalls/mongodb_api.py | anirbanroydas/uberNow | 562a15b9dd82aa32c92992e33d295f1eef67516b | [
"MIT"
] | null | null | null | uberNow/apps/apicalls/mongodb_api.py | anirbanroydas/uberNow | 562a15b9dd82aa32c92992e33d295f1eef67516b | [
"MIT"
] | 1 | 2017-10-27T17:53:28.000Z | 2017-10-27T17:53:28.000Z | from tornado import gen
import pymongo.errors
import random
import uberNow.utils
LOGGER = uberNow.utils.LOGGER
MAX_AUTO_RECONNECT_ATTEMPTS = 20
MAX_DUPLICATE_ERROR_ATTEMPTS = 20
MAX_EXECUTIONS_LIMIT = 5
MAX_RECONNECTIONS_LIMIT = 5
def handle_failover(f):
@gen.coroutine
def wrapper(*args, **kwargs):
retries = ... | 33.989247 | 119 | 0.570705 | from tornado import gen
import pymongo.errors
import random
import uberNow.utils
LOGGER = uberNow.utils.LOGGER
MAX_AUTO_RECONNECT_ATTEMPTS = 20
MAX_DUPLICATE_ERROR_ATTEMPTS = 20
MAX_EXECUTIONS_LIMIT = 5
MAX_RECONNECTIONS_LIMIT = 5
def handle_failover(f):
@gen.coroutine
def wrapper(*args, **kwargs):
retries = ... | false | true |
1c1269447ff2830c8d00879bd42686c53c8fc5a0 | 12,787 | py | Python | resnet-playground/MainUI.py | OlafenwaMoses/Model-Playgrounds | 9848b4c9bcce5fc4650ceb38347ff120685050a0 | [
"MIT"
] | 14 | 2018-02-02T07:49:05.000Z | 2021-08-28T19:38:50.000Z | resnet-playground/MainUI.py | maxprog/Model-Playgrounds | 9848b4c9bcce5fc4650ceb38347ff120685050a0 | [
"MIT"
] | null | null | null | resnet-playground/MainUI.py | maxprog/Model-Playgrounds | 9848b4c9bcce5fc4650ceb38347ff120685050a0 | [
"MIT"
] | 12 | 2018-02-03T10:13:39.000Z | 2020-10-18T12:19:31.000Z | """
#AUTHORS
*** Moses Olafenwa
*** John Olafenwa
>> January, 2018
#NOTES
Please remember to replace the string "PROGRAM_INSTALL_FULLPATH" with the full path
of your program install folder in every instance that it is used in the code below.
You may use relative purpose for debugging, but please note that y... | 48.805344 | 222 | 0.633612 |
import wx
import wx.adv
from wx.lib.wordwrap import wordwrap
import os
from wx.lib.pubsub import pub, setupkwargs
import threading
class actionThreadResNet(threading.Thread):
def __init__(self, path, model_path, index_file_path, main_ui):
threading.Thread.__init__(self)
se... | true | true |
1c126a53244404197ac9779472c09529fadfd14e | 20,408 | py | Python | models/pidnet_large_add128_dappm112_add_nonpre.py | JiacongXu666/lalala | be513ed1dd394f2c09ce43bd377f26868ad9aa74 | [
"MIT"
] | null | null | null | models/pidnet_large_add128_dappm112_add_nonpre.py | JiacongXu666/lalala | be513ed1dd394f2c09ce43bd377f26868ad9aa74 | [
"MIT"
] | null | null | null | models/pidnet_large_add128_dappm112_add_nonpre.py | JiacongXu666/lalala | be513ed1dd394f2c09ce43bd377f26868ad9aa74 | [
"MIT"
] | null | null | null | import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from collections import OrderedDict
import time
from . import model_utils
import logging
BatchNorm2d = nn.BatchNorm2d
bn_mom = 0.1
algc = False
def conv3x3(in_planes, out_planes, stride=1):... | 40.97992 | 126 | 0.530723 | import math
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from collections import OrderedDict
import time
from . import model_utils
import logging
BatchNorm2d = nn.BatchNorm2d
bn_mom = 0.1
algc = False
def conv3x3(in_planes, out_planes, stride=1):... | true | true |
1c126a789f3ac605350e78610196eb414b860411 | 368 | py | Python | draft/test_pyjulia.py | krystophny/profit | c6316c9df7cfaa7b30332fdbbf85ad27175eaf92 | [
"MIT"
] | 14 | 2019-12-03T14:11:28.000Z | 2022-03-15T13:44:06.000Z | draft/test_pyjulia.py | krystophny/profit | c6316c9df7cfaa7b30332fdbbf85ad27175eaf92 | [
"MIT"
] | 118 | 2019-11-16T19:51:26.000Z | 2022-03-26T13:52:00.000Z | draft/test_pyjulia.py | krystophny/profit | c6316c9df7cfaa7b30332fdbbf85ad27175eaf92 | [
"MIT"
] | 9 | 2020-06-08T07:22:56.000Z | 2021-03-21T14:12:21.000Z | """
Created: Tue Jul 30 07:56:52 2019
@author: Christopher Albert <albert@alumni.tugraz.at>
"""
import os
import site
from julia.api import LibJulia, Julia
api = LibJulia.load(julia=os.path.join(site.USER_BASE, 'bin', 'julia-py'))
api.sysimage = 'julia_sysimage.so'
api.init_julia()
#%%
ret = api.jl_eval_string(b"si... | 20.444444 | 74 | 0.728261 | import os
import site
from julia.api import LibJulia, Julia
api = LibJulia.load(julia=os.path.join(site.USER_BASE, 'bin', 'julia-py'))
api.sysimage = 'julia_sysimage.so'
api.init_julia()
ret = api.jl_eval_string(b"sin(pi)")
print(float(api.jl_unbox_float64(ret)))
| true | true |
1c126b13c64bfaa25ad5d82c0a65062b776d2f1b | 5,421 | py | Python | spoons/spoons.py | dallonf/because-i-can | 4987b33ea462a44e62b0266ded582c7f787ecaee | [
"MIT"
] | 1 | 2017-08-02T22:54:23.000Z | 2017-08-02T22:54:23.000Z | spoons/spoons.py | dallonf/because-i-can | 4987b33ea462a44e62b0266ded582c7f787ecaee | [
"MIT"
] | null | null | null | spoons/spoons.py | dallonf/because-i-can | 4987b33ea462a44e62b0266ded582c7f787ecaee | [
"MIT"
] | null | null | null | import random
import itertools
import csv
from typing import List, Union, Optional, NamedTuple
# Configuration
SIMULATE_ROUNDS = 1000
MATCH_SIZE = 4
MAX_RESHUFFLES = 10
# Data types
class Card(NamedTuple):
suit: str
rank: Union[str, int]
Hand = List[Card]
class Player:
@property
def number(self... | 30.627119 | 155 | 0.610035 | import random
import itertools
import csv
from typing import List, Union, Optional, NamedTuple
SIMULATE_ROUNDS = 1000
MATCH_SIZE = 4
MAX_RESHUFFLES = 10
class Card(NamedTuple):
suit: str
rank: Union[str, int]
Hand = List[Card]
class Player:
@property
def number(self):
return self._numbe... | true | true |
1c126b89167c54c05528c7705232861c2c616eb6 | 1,925 | py | Python | gui/qt/qrtextedit.py | Sibcoin-developers/electrum-sibcoin-client | a198b8d031fb8b6808125955c6363968f405f62d | [
"MIT"
] | null | null | null | gui/qt/qrtextedit.py | Sibcoin-developers/electrum-sibcoin-client | a198b8d031fb8b6808125955c6363968f405f62d | [
"MIT"
] | null | null | null | gui/qt/qrtextedit.py | Sibcoin-developers/electrum-sibcoin-client | a198b8d031fb8b6808125955c6363968f405f62d | [
"MIT"
] | null | null | null | from electrum_sib.i18n import _
from electrum_sib.plugins import run_hook
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from util import ButtonsTextEdit, MessageBoxMixin
class ShowQRTextEdit(ButtonsTextEdit):
def __init__(self, text=None):
ButtonsTextEdit.__init__(self, text)
self.setRead... | 29.615385 | 79 | 0.622857 | from electrum_sib.i18n import _
from electrum_sib.plugins import run_hook
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from util import ButtonsTextEdit, MessageBoxMixin
class ShowQRTextEdit(ButtonsTextEdit):
def __init__(self, text=None):
ButtonsTextEdit.__init__(self, text)
self.setRead... | true | true |
1c126bb605c4e7216ac1fb83b5bb86069c52656a | 4,425 | py | Python | Calculadora V3.0.py | KillianSan/Calculadora | a55799240744a7df066fa1dc307bdb41b26d9abd | [
"MIT"
] | 1 | 2021-01-06T15:28:14.000Z | 2021-01-06T15:28:14.000Z | Calculadora V3.0.py | KillianSan/Calculadora | a55799240744a7df066fa1dc307bdb41b26d9abd | [
"MIT"
] | 3 | 2019-01-19T20:03:39.000Z | 2020-10-31T19:13:26.000Z | Calculadora V3.0.py | KillianSan/Calculadora | a55799240744a7df066fa1dc307bdb41b26d9abd | [
"MIT"
] | 1 | 2021-01-06T09:17:26.000Z | 2021-01-06T09:17:26.000Z | def calculate():
operation = input('''
Calculadora do Killian San aka Matilha San:
Por favor, escolha uma das operações e digite o simbolo dela ou o nome e depois aperte ENTER:
+ adição | 3+ adição de 3 números | 4+ adição de 4 números
- subtração | 3- subtração de 3 números |... | 35.685484 | 176 | 0.569718 | def calculate():
operation = input('''
Calculadora do Killian San aka Matilha San:
Por favor, escolha uma das operações e digite o simbolo dela ou o nome e depois aperte ENTER:
+ adição | 3+ adição de 3 números | 4+ adição de 4 números
- subtração | 3- subtração de 3 números |... | true | true |
1c126c33c3c430b05580a0263433b4469adf516f | 3,945 | py | Python | scTenifoldXct/pcNet.py | cailab-tamu/scTenifoldXct | d25ded8dfb7f2951217a30ab71eccd6b060178f6 | [
"MIT"
] | null | null | null | scTenifoldXct/pcNet.py | cailab-tamu/scTenifoldXct | d25ded8dfb7f2951217a30ab71eccd6b060178f6 | [
"MIT"
] | null | null | null | scTenifoldXct/pcNet.py | cailab-tamu/scTenifoldXct | d25ded8dfb7f2951217a30ab71eccd6b060178f6 | [
"MIT"
] | null | null | null | import numpy as np
from numpy.linalg import svd
from scipy import sparse
import os
import time
import ray
def pcCoefficients(X, K, nComp):
y = X[:, K]
Xi = np.delete(X, K, 1)
U, s, VT = svd(Xi, full_matrices=False)
#print ('U:', U.shape, 's:', s.shape, 'VT:', VT.shape)
V = VT[:nComp, :].T
#p... | 34.008621 | 109 | 0.52218 | import numpy as np
from numpy.linalg import svd
from scipy import sparse
import os
import time
import ray
def pcCoefficients(X, K, nComp):
y = X[:, K]
Xi = np.delete(X, K, 1)
U, s, VT = svd(Xi, full_matrices=False)
V = VT[:nComp, :].T
score = Xi@V
t = np.sqrt(np.sum(score**2, axis=0)... | true | true |
1c126c64fc3f7c0118ad8960ec84e3de0d74836f | 410 | py | Python | Aula_014.py | juliosimply/Aulas-Python-Guanabara | fc3d230e4646cf83250404a20dadeef90ab2e676 | [
"MIT"
] | null | null | null | Aula_014.py | juliosimply/Aulas-Python-Guanabara | fc3d230e4646cf83250404a20dadeef90ab2e676 | [
"MIT"
] | null | null | null | Aula_014.py | juliosimply/Aulas-Python-Guanabara | fc3d230e4646cf83250404a20dadeef90ab2e676 | [
"MIT"
] | null | null | null | #Estrutura de repetição while, diferentemente do for que geralmente sabemos onde começa e onde termina, o while vai loopar até a condição ser atingica
'''for c in range(1,10):
print(c)
print('fim')'''
n = 1
par = impar = 0
while n != 0:
n = int(input('Digite um valor'))
if n % 2 ==0:
par +=1
e... | 27.333333 | 151 | 0.636585 |
n = 1
par = impar = 0
while n != 0:
n = int(input('Digite um valor'))
if n % 2 ==0:
par +=1
else:
impar +=1
print(f'vc digitou {par} numeros pares e {impar} numeros impares')
| true | true |
1c126cb16640ca947881737c8b106dc9744c59f2 | 16,396 | py | Python | nemo/collections/tts/helpers/helpers.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | null | null | null | nemo/collections/tts/helpers/helpers.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | 1 | 2021-11-10T14:59:54.000Z | 2021-11-12T16:42:14.000Z | nemo/collections/tts/helpers/helpers.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | 2 | 2021-11-04T14:39:00.000Z | 2021-11-04T14:56:30.000Z | # Copyright (c) 2020, 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... | 34.959488 | 131 | 0.656746 |
from enum import Enum
from typing import Dict, Sequence
import librosa
import matplotlib.pylab as plt
import numpy as np
import torch
from numba import jit, prange
from numpy import ndarray
from pesq import pesq
from pystoi import stoi
from nemo.utils import logging
try:
from pytorch_lightning.utilities import ... | true | true |
1c126d80530323762dfc22319df7757769324947 | 1,362 | py | Python | src/models/modules/vector_sage_module.py | bartek-wojcik/graph_agregations | 12305e4ffdf4db60da041689f04d96b48e9e72e5 | [
"MIT"
] | null | null | null | src/models/modules/vector_sage_module.py | bartek-wojcik/graph_agregations | 12305e4ffdf4db60da041689f04d96b48e9e72e5 | [
"MIT"
] | null | null | null | src/models/modules/vector_sage_module.py | bartek-wojcik/graph_agregations | 12305e4ffdf4db60da041689f04d96b48e9e72e5 | [
"MIT"
] | null | null | null | from torch import nn
from torch_geometric.nn import (
global_max_pool,
)
import torch.nn.functional as F
from src.models.modules.vector_sage import VectorSAGE
class VectorSAGEModule(nn.Module):
def __init__(self, hparams: dict):
super().__init__()
self.hparams = hparams
if hparams["n... | 30.954545 | 108 | 0.625551 | from torch import nn
from torch_geometric.nn import (
global_max_pool,
)
import torch.nn.functional as F
from src.models.modules.vector_sage import VectorSAGE
class VectorSAGEModule(nn.Module):
def __init__(self, hparams: dict):
super().__init__()
self.hparams = hparams
if hparams["n... | true | true |
1c126d9f45ed6689007abeb132fb6132302d7fcf | 288 | py | Python | actions/translate.py | jespino/matteractions | a9cfe75271c554ab2df831c0c950be4f1f4e6db9 | [
"BSD-2-Clause"
] | null | null | null | actions/translate.py | jespino/matteractions | a9cfe75271c554ab2df831c0c950be4f1f4e6db9 | [
"BSD-2-Clause"
] | null | null | null | actions/translate.py | jespino/matteractions | a9cfe75271c554ab2df831c0c950be4f1f4e6db9 | [
"BSD-2-Clause"
] | null | null | null | # Imports the Google Cloud client library
from google.cloud import translate as trans
def translate(text, target):
translate_client = trans.Client()
translation = translate_client.translate(
text,
target_language=target)
return translation['translatedText']
| 26.181818 | 45 | 0.736111 | from google.cloud import translate as trans
def translate(text, target):
translate_client = trans.Client()
translation = translate_client.translate(
text,
target_language=target)
return translation['translatedText']
| true | true |
1c126dc6d58a36d74c795354ea734fe31906519a | 11,658 | py | Python | nbx/om2.py | mirkoklukas/nbx | 2181c7a5fb49a167eae07a73ffc3d95c4ee953c8 | [
"Apache-2.0"
] | null | null | null | nbx/om2.py | mirkoklukas/nbx | 2181c7a5fb49a167eae07a73ffc3d95c4ee953c8 | [
"Apache-2.0"
] | 4 | 2021-01-25T20:23:14.000Z | 2022-02-26T06:21:38.000Z | nbx/om2.py | mirkoklukas/nbx | 2181c7a5fb49a167eae07a73ffc3d95c4ee953c8 | [
"Apache-2.0"
] | null | null | null | #AUTOGENERATED! DO NOT EDIT! File to edit: dev/om2.ipynb (unless otherwise specified).
__all__ = ['extract_tag', 'regex_tag', 'contains_tag', 'is_nbx', 'is_nbx_cell', 'is_magic_or_shell', 'regex_magic',
'strip', 'parse_xarg_expr', 'regex_xarg', 'Bunch', 'load_nb', 'parse_src_with_parse_dict', 'parse_none',
... | 27.495283 | 125 | 0.612283 |
__all__ = ['extract_tag', 'regex_tag', 'contains_tag', 'is_nbx', 'is_nbx_cell', 'is_magic_or_shell', 'regex_magic',
'strip', 'parse_xarg_expr', 'regex_xarg', 'Bunch', 'load_nb', 'parse_src_with_parse_dict', 'parse_none',
'parse_nbx', 'parse_xarg', 'parse_xuse', 'consume_line_below', 'parse_nbx_ce... | true | true |
1c126df228d2527fd39334e6c3e4295c67a717f3 | 19,122 | py | Python | src/pretix/base/models/auth.py | fabm3n/pretix | 520fb620888d5c434665a6a4a33cb2ab22dd42c7 | [
"Apache-2.0"
] | 1,248 | 2015-04-24T13:32:06.000Z | 2022-03-29T07:01:36.000Z | src/pretix/base/models/auth.py | fabm3n/pretix | 520fb620888d5c434665a6a4a33cb2ab22dd42c7 | [
"Apache-2.0"
] | 2,113 | 2015-02-18T18:58:16.000Z | 2022-03-31T11:12:32.000Z | src/pretix/base/models/auth.py | fabm3n/pretix | 520fb620888d5c434665a6a4a33cb2ab22dd42c7 | [
"Apache-2.0"
] | 453 | 2015-05-13T09:29:06.000Z | 2022-03-24T13:39:16.000Z | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by ... | 37.56778 | 118 | 0.644755 |
import binascii
import json
from datetime import timedelta
from urllib.parse import urlparse
import webauthn
from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, BaseUserManager, PermissionsMixin,
)
from django.contrib.auth.tokens import default_token_generator
from django.... | true | true |
1c126e0cfb3cec6f93ac6185332b30865a1bbe1c | 3,212 | py | Python | scgv/views/sample.py | lchorbadjiev/SCGV | 7b2fd1fbada7bea49166e37bcb82bd742617fe51 | [
"MIT"
] | null | null | null | scgv/views/sample.py | lchorbadjiev/SCGV | 7b2fd1fbada7bea49166e37bcb82bd742617fe51 | [
"MIT"
] | null | null | null | scgv/views/sample.py | lchorbadjiev/SCGV | 7b2fd1fbada7bea49166e37bcb82bd742617fe51 | [
"MIT"
] | null | null | null | '''
Created on Dec 14, 2016
@author: lubo
'''
import numpy as np
from scgv.views.base import ViewerBase
class SamplesViewer(ViewerBase):
def __init__(self, model):
super(SamplesViewer, self).__init__(model)
def calc_chrom_lines(self):
return self.model.calc_chrom_lines()
def calc_ploid... | 34.170213 | 78 | 0.573474 | import numpy as np
from scgv.views.base import ViewerBase
class SamplesViewer(ViewerBase):
def __init__(self, model):
super(SamplesViewer, self).__init__(model)
def calc_chrom_lines(self):
return self.model.calc_chrom_lines()
def calc_ploidy(self, sample_name):
return self.model... | true | true |
1c126e5520df5924f9e320b8996b1ab55df99c85 | 3,586 | py | Python | enbo/util/glasses.py | shalijiang/bo | af13f0a38b579ab504f49a01f1ced13532a3ad49 | [
"MIT"
] | 3 | 2020-08-07T17:15:57.000Z | 2021-07-12T11:16:44.000Z | enbo/util/glasses.py | shalijiang/bo | af13f0a38b579ab504f49a01f1ced13532a3ad49 | [
"MIT"
] | 1 | 2021-06-07T08:22:11.000Z | 2021-07-07T23:02:14.000Z | enbo/util/glasses.py | shalijiang/bo | af13f0a38b579ab504f49a01f1ced13532a3ad49 | [
"MIT"
] | null | null | null | import torch
from botorch.models.model import Model
from botorch.acquisition import AcquisitionFunction
from botorch.acquisition.monte_carlo import qExpectedImprovement
from botorch.acquisition.analytic import ExpectedImprovement
from torch import Tensor
from botorch.optim import optimize_acqf
from botorch.sampling.sam... | 30.649573 | 87 | 0.646403 | import torch
from botorch.models.model import Model
from botorch.acquisition import AcquisitionFunction
from botorch.acquisition.monte_carlo import qExpectedImprovement
from botorch.acquisition.analytic import ExpectedImprovement
from torch import Tensor
from botorch.optim import optimize_acqf
from botorch.sampling.sam... | true | true |
1c126e9f3c6f26d1e927592c983c7d9f93df7612 | 389 | py | Python | gallerys/migrations/0002_remove_category_image_upload.py | joseck12/josecksgallery | 3c37c32d1b1538e8f71800f2fe778c7a982b9635 | [
"Unlicense"
] | null | null | null | gallerys/migrations/0002_remove_category_image_upload.py | joseck12/josecksgallery | 3c37c32d1b1538e8f71800f2fe778c7a982b9635 | [
"Unlicense"
] | null | null | null | gallerys/migrations/0002_remove_category_image_upload.py | joseck12/josecksgallery | 3c37c32d1b1538e8f71800f2fe778c7a982b9635 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-09-28 05:05
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gallerys', '0001_initial'),
]
operations = [
migrations.RemoveField(
mode... | 19.45 | 46 | 0.611825 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gallerys', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='image_upload',
),
]
| true | true |
1c126f0020a5ae5b134e0458afece13e28032eda | 15,176 | py | Python | paypal/standard/ipn/south_migrations/0007_auto__add_field_paypalipn_option_selection1__add_field_paypalipn_optio.py | mpachas/django-paypal | 94fa69cc490cc54e1e31fd8b899a39770de988a1 | [
"MIT"
] | 1 | 2021-02-12T09:28:52.000Z | 2021-02-12T09:28:52.000Z | paypal/standard/ipn/south_migrations/0007_auto__add_field_paypalipn_option_selection1__add_field_paypalipn_optio.py | mpachas/django-paypal | 94fa69cc490cc54e1e31fd8b899a39770de988a1 | [
"MIT"
] | 3 | 2020-02-11T23:23:42.000Z | 2021-06-10T18:43:15.000Z | paypal/standard/ipn/south_migrations/0007_auto__add_field_paypalipn_option_selection1__add_field_paypalipn_optio.py | mpachas/django-paypal | 94fa69cc490cc54e1e31fd8b899a39770de988a1 | [
"MIT"
] | 1 | 2018-12-05T16:22:02.000Z | 2018-12-05T16:22:02.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'PayPalIPN.option_selection1'
db.add_column(u'paypal_ipn',... | 101.173333 | 177 | 0.570572 | from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'paypal_ipn', 'option_selection1',
self.gf('django.db.models... | true | true |
1c126f15776b35e4006c6d9793f534f98154696b | 1,902 | py | Python | costar_task_plan/python/costar_task_plan/tools/evaluate_mcts.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 66 | 2018-10-31T04:58:53.000Z | 2022-03-17T02:32:25.000Z | costar_task_plan/python/costar_task_plan/tools/evaluate_mcts.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 8 | 2018-10-23T21:19:25.000Z | 2018-12-03T02:08:41.000Z | costar_task_plan/python/costar_task_plan/tools/evaluate_mcts.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 25 | 2018-10-19T00:54:17.000Z | 2021-10-10T08:28:15.000Z | import os
import numpy as np
# TODO(cpaxton): remove pygame from this
#import pygame as pg
from costar_task_plan.mcts import Node
'''
loop over all MCTS scenarios
- generate the scenarios you need to collect the data
- create
'''
def mctsLoop(env, policies, seed, save, animate, **kwargs):
if seed is not None:... | 26.054795 | 78 | 0.592534 | import os
import numpy as np
from costar_task_plan.mcts import Node
def mctsLoop(env, policies, seed, save, animate, **kwargs):
if seed is not None:
world_id = int(seed)
else:
world_id = np.random.randint(10000)
np.random.seed(world_id)
env.reset()
world = env._world
curren... | true | true |
1c126f50bf09570d6cf1bc100d9c07f8822dfc47 | 17,854 | py | Python | dev/merge_spark_pr.py | dongwang218/spark | 48fc38f5844f6c12bf440f2990b6d7f1630fafac | [
"Apache-2.0",
"MIT"
] | 1 | 2017-04-18T20:51:02.000Z | 2017-04-18T20:51:02.000Z | dev/merge_spark_pr.py | dongwang218/spark | 48fc38f5844f6c12bf440f2990b6d7f1630fafac | [
"Apache-2.0",
"MIT"
] | null | null | null | dev/merge_spark_pr.py | dongwang218/spark | 48fc38f5844f6c12bf440f2990b6d7f1630fafac | [
"Apache-2.0",
"MIT"
] | 2 | 2017-04-18T20:51:02.000Z | 2020-12-10T01:32:09.000Z | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Li... | 40.855835 | 128 | 0.655819 |
import json
import os
import re
import subprocess
import sys
import urllib2
try:
import jira.client
JIRA_IMPORTED = True
except ImportError:
JIRA_IMPORTED = False
SPARK_HOME = os.environ.get("SPARK_HOME", os.getcwd())
PR_REMOTE_NAME = os.environ.get("PR_REMOTE_NAME", "apache-github")
PUSH_REMOTE_NAME =... | false | true |
1c126f9361697e76e625ef40932a087ca044d12a | 1,766 | py | Python | SirIsaac/mpi_basic.py | diging/SirIsaac | d10531e6d82cf5b485768487f112ccffb973ffdb | [
"MIT"
] | 39 | 2015-08-24T14:55:02.000Z | 2022-03-14T20:58:14.000Z | SirIsaac/mpi_basic.py | EmoryUniversityTheoreticalBiophysics/SirIsaac | d10531e6d82cf5b485768487f112ccffb973ffdb | [
"MIT"
] | 20 | 2015-09-10T17:36:32.000Z | 2021-03-03T19:55:15.000Z | SirIsaac/mpi_basic.py | diging/SirIsaac | d10531e6d82cf5b485768487f112ccffb973ffdb | [
"MIT"
] | 14 | 2015-08-24T14:55:06.000Z | 2020-12-08T10:54:56.000Z | # mpi_basic.py
#
# Bryan Daniels
# 2020/04/20
#
# Basic MPI functionality. As of 2020/06/03, only used by test_parallel.
#
# Run like so:
# mpirun -np 3 python mpi_test.py test_input_filename
#
import sys
from simplePickle import load,save
from mpi4py import MPI
comm = MPI.COMM_WORLD
my_rank = comm.Get_rank()
num_... | 25.228571 | 83 | 0.560023 |
import sys
from simplePickle import load,save
from mpi4py import MPI
comm = MPI.COMM_WORLD
my_rank = comm.Get_rank()
num_procs = comm.Get_size()
if __name__ == '__main__':
if len(sys.argv) < 2 or len(sys.argv) > 2:
print "Usage: mpirun -np [numprocs] python mpi_test.py test_input_filename"
e... | false | true |
1c126f947cacb8b9ff1fe6bacc07f8cdd1ce6385 | 260 | py | Python | idm_lp/models/__init__.py | cloode/mxrtemgxd | 7826c664c68ab4a36430aa9ad852c1b8d1b3e136 | [
"MIT"
] | 1 | 2021-11-20T08:00:38.000Z | 2021-11-20T08:00:38.000Z | idm_lp/models/__init__.py | Dafu508/Lppp | 4f4750e38d4a3b2fa842f07635fabd08200b3531 | [
"MIT"
] | 2 | 2021-04-06T18:28:57.000Z | 2021-06-02T03:48:26.000Z | idm_lp/models/__init__.py | Dafu508/Lppp | 4f4750e38d4a3b2fa842f07635fabd08200b3531 | [
"MIT"
] | 1 | 2021-03-23T17:58:42.000Z | 2021-03-23T17:58:42.000Z | from .alias import Alias, AliasPydantic
from .ignored_members import IgnoredMember, IgnoredGlobalMember, MutedMember
from .role_play_commands import RolePlayCommandGenEnum, RolePlayCommand, RolePlayCommandPydantic
from .settings import Settings, EFCSchemeEnum
| 52 | 96 | 0.876923 | from .alias import Alias, AliasPydantic
from .ignored_members import IgnoredMember, IgnoredGlobalMember, MutedMember
from .role_play_commands import RolePlayCommandGenEnum, RolePlayCommand, RolePlayCommandPydantic
from .settings import Settings, EFCSchemeEnum
| true | true |
1c1270da69792f3f8fc9ba51da35e88f1b995db0 | 216 | py | Python | python/alpenglow/evaluation/PrecisionScore.py | fbobee/Alpenglow | 5f956511017c1bee72390aaecd964c04d8ad4b45 | [
"Apache-2.0"
] | 28 | 2017-07-23T22:47:44.000Z | 2022-03-12T15:11:13.000Z | python/alpenglow/evaluation/PrecisionScore.py | fbobee/Alpenglow | 5f956511017c1bee72390aaecd964c04d8ad4b45 | [
"Apache-2.0"
] | 4 | 2017-05-10T10:23:17.000Z | 2019-05-23T14:07:09.000Z | python/alpenglow/evaluation/PrecisionScore.py | fbobee/Alpenglow | 5f956511017c1bee72390aaecd964c04d8ad4b45 | [
"Apache-2.0"
] | 9 | 2017-05-04T09:20:58.000Z | 2021-12-14T08:19:01.000Z | import pandas as pd
import numpy as np
import math
def Precision(rank):
if(np.isnan(rank)):
return 0
else:
return 1
def PrecisionScore(rankings):
return rankings['rank'].map(Precision)
| 15.428571 | 42 | 0.662037 | import pandas as pd
import numpy as np
import math
def Precision(rank):
if(np.isnan(rank)):
return 0
else:
return 1
def PrecisionScore(rankings):
return rankings['rank'].map(Precision)
| true | true |
1c1271ac5b219949828a97246016369177fec5a4 | 3,335 | py | Python | tests/test_dataclasses.py | xnuinside/py-models-parser | c89f12f0c33e28dc86f74172246e4e4d9a7037a8 | [
"MIT"
] | 9 | 2021-05-06T06:19:27.000Z | 2021-09-27T16:07:04.000Z | tests/test_dataclasses.py | xnuinside/py-models-parser | c89f12f0c33e28dc86f74172246e4e4d9a7037a8 | [
"MIT"
] | 1 | 2021-07-05T12:52:53.000Z | 2021-07-06T11:53:54.000Z | tests/test_dataclasses.py | xnuinside/py-models-parser | c89f12f0c33e28dc86f74172246e4e4d9a7037a8 | [
"MIT"
] | 1 | 2021-05-06T14:17:14.000Z | 2021-05-06T14:17:14.000Z | from py_models_parser import parse
def test_dataclasses():
expected = [
{
"attrs": [
{
"default": "'article'",
"name": "article",
"properties": {},
"type": None,
},
{... | 29.254386 | 88 | 0.358621 | from py_models_parser import parse
def test_dataclasses():
expected = [
{
"attrs": [
{
"default": "'article'",
"name": "article",
"properties": {},
"type": None,
},
{... | true | true |
1c12723957eb12b1bdcd6f5264d898489fb22977 | 2,169 | py | Python | custom_crawler/utils/redis_bloomfilter.py | who0sy/custom_crawler | 8493be3d77ddda727832236e856177538aee9668 | [
"Apache-2.0"
] | 12 | 2020-07-20T15:38:38.000Z | 2022-03-31T06:44:39.000Z | custom/work_utils/redis_bloomfilter.py | pythonyhd/tianyancha | 6fc74df94ab7e7af4e55303b8d78d78c4c66c29d | [
"Apache-2.0"
] | 2 | 2022-03-02T15:01:55.000Z | 2022-03-26T11:42:17.000Z | custom/work_utils/redis_bloomfilter.py | pythonyhd/tianyancha | 6fc74df94ab7e7af4e55303b8d78d78c4c66c29d | [
"Apache-2.0"
] | 3 | 2020-08-06T02:49:07.000Z | 2022-03-14T17:49:11.000Z | # -*- coding: utf-8 -*-
import redis
from hashlib import md5
class SimpleHash(object):
def __init__(self, cap, seed):
self.cap = cap
self.seed = seed
def hash(self, value):
ret = 0
for i in range(len(value)):
ret += self.seed * ret + ord(value[i])
return (s... | 31.434783 | 118 | 0.569387 | import redis
from hashlib import md5
class SimpleHash(object):
def __init__(self, cap, seed):
self.cap = cap
self.seed = seed
def hash(self, value):
ret = 0
for i in range(len(value)):
ret += self.seed * ret + ord(value[i])
return (self.cap - 1) & ret
cla... | true | true |
1c12723d930d65a87ef54c77559274f76e5396a7 | 1,931 | bzl | Python | packages.bzl | akd-io/components | 17f25462bf556d5e86fa4816548ecfde4935b30a | [
"MIT"
] | 1 | 2019-11-22T07:10:52.000Z | 2019-11-22T07:10:52.000Z | packages.bzl | akd-io/components | 17f25462bf556d5e86fa4816548ecfde4935b30a | [
"MIT"
] | 1 | 2022-01-15T02:47:22.000Z | 2022-01-15T02:47:22.000Z | packages.bzl | akd-io/components | 17f25462bf556d5e86fa4816548ecfde4935b30a | [
"MIT"
] | null | null | null | # Each individual package uses a placeholder for the version of Angular to ensure they're
# all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
# version for the placeholders.
ANGULAR_PACKAGE_VERSION = "^8.0.0 || ^9.0.0-0"
MDC_PACKAGE_VERSION = "^4.0.0-alpha.0"
VERSION_PLACEHOLDER_REPLA... | 60.34375 | 108 | 0.743656 | # all in-sync. This map is passed to each ng_package rule to stamp out the appropriate
# version for the placeholders.
ANGULAR_PACKAGE_VERSION = "^8.0.0 || ^9.0.0-0"
MDC_PACKAGE_VERSION = "^4.0.0-alpha.0"
VERSION_PLACEHOLDER_REPLACEMENTS = {
"0.0.0-MDC": MDC_PACKAGE_VERSION,
"0.0.0-NG": ANGULAR_PACKAGE_VERSION,... | true | true |
1c127272775850ec959fb1211f99685593582a32 | 2,964 | py | Python | lintly/patch.py | 23andMe/Lintly | 9c9d3ee9b2c633f18e4809b839bf8121f6101f98 | [
"MIT"
] | null | null | null | lintly/patch.py | 23andMe/Lintly | 9c9d3ee9b2c633f18e4809b839bf8121f6101f98 | [
"MIT"
] | 7 | 2021-03-01T22:34:40.000Z | 2021-12-17T16:47:12.000Z | lintly/patch.py | 23andMe/Lintly | 9c9d3ee9b2c633f18e4809b839bf8121f6101f98 | [
"MIT"
] | null | null | null | import logging
from autologging import logged, traced
import re
from cached_property import cached_property
FILE_NAME_LINE = re.compile(r'^\+\+\+ b/(?P<file_name>.+)')
RANGE_INFORMATION_LINE = re.compile(r'^@@ .+\+(?P<line_number>\d+),')
MODIFIED_LINE = re.compile(r'^\+(?!\+|\+)')
NOT_REMOVED_OR_NEWLINE_WARNING = re... | 34.068966 | 100 | 0.580297 | import logging
from autologging import logged, traced
import re
from cached_property import cached_property
FILE_NAME_LINE = re.compile(r'^\+\+\+ b/(?P<file_name>.+)')
RANGE_INFORMATION_LINE = re.compile(r'^@@ .+\+(?P<line_number>\d+),')
MODIFIED_LINE = re.compile(r'^\+(?!\+|\+)')
NOT_REMOVED_OR_NEWLINE_WARNING = re... | true | true |
1c12747eba60ae8890e2d2ed4744535c37a90072 | 25,333 | py | Python | lib/util.py | jimtje/fake-electrum-real-malware | ed4b15a8721e142d5d867c5883df4aeab8555ffe | [
"MIT"
] | null | null | null | lib/util.py | jimtje/fake-electrum-real-malware | ed4b15a8721e142d5d867c5883df4aeab8555ffe | [
"MIT"
] | null | null | null | lib/util.py | jimtje/fake-electrum-real-malware | ed4b15a8721e142d5d867c5883df4aeab8555ffe | [
"MIT"
] | null | null | null | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... | 30.448317 | 119 | 0.606561 | import binascii
import os, sys, re, json
from collections import defaultdict
from datetime import datetime
from decimal import Decimal
import traceback
import urllib
import threading
import hmac
from .i18n import _
import urllib.request, urllib.parse, urllib.error
import queue
def inv_dict(d):
return {v: k for ... | true | true |
1c12755909290c5c584bd7bca9a1e05e55aff89d | 1,169 | py | Python | docker/dstat/plugins/dstat_vm_cpu.py | hzy9819/GreenPlum_WooKongDB | 9dca9b3bcd15f29b2a0136acc818064222220059 | [
"PostgreSQL",
"Apache-2.0"
] | 34 | 2021-01-18T14:25:24.000Z | 2021-06-05T03:21:10.000Z | docker/dstat/plugins/dstat_vm_cpu.py | hzy9819/GreenPlum_WooKongDB | 9dca9b3bcd15f29b2a0136acc818064222220059 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | docker/dstat/plugins/dstat_vm_cpu.py | hzy9819/GreenPlum_WooKongDB | 9dca9b3bcd15f29b2a0136acc818064222220059 | [
"PostgreSQL",
"Apache-2.0"
] | 2 | 2021-04-20T20:11:08.000Z | 2021-06-02T02:56:16.000Z | ### Author: Bert de Bruijn <bert+dstat$debruijn,be>
### VMware cpu stats
### Displays CPU stats coming from the hypervisor inside VMware VMs.
### The vmGuestLib API from VMware Tools needs to be installed
class dstat_plugin(dstat):
def __init__(self):
self.name = 'vm cpu'
self.vars = ('used', 'sto... | 29.974359 | 131 | 0.579983 |
class dstat_plugin(dstat):
def __init__(self):
self.name = 'vm cpu'
self.vars = ('used', 'stolen', 'elapsed')
self.nick = ('usd', 'stl')
self.type = 'p'
self.width = 3
self.scale = 100
self.cpunr = getcpunr()
def check(self):
try:
gl... | true | true |
1c1275b35c7508eb8d9ba0b5c10667990111d8b7 | 655 | py | Python | mfr/ext/tabular/tests/test_xlsx_tools.py | mfraezz/modular-file-renderer | f45d92f5af547fe356c86d9e5497b2130c07647b | [
"Apache-2.0"
] | null | null | null | mfr/ext/tabular/tests/test_xlsx_tools.py | mfraezz/modular-file-renderer | f45d92f5af547fe356c86d9e5497b2130c07647b | [
"Apache-2.0"
] | null | null | null | mfr/ext/tabular/tests/test_xlsx_tools.py | mfraezz/modular-file-renderer | f45d92f5af547fe356c86d9e5497b2130c07647b | [
"Apache-2.0"
] | null | null | null | import os
from ..libs import xlrd_tools
HERE = os.path.dirname(os.path.abspath(__file__))
def test_xlsx_xlrd():
with open(os.path.join(HERE, 'fixtures', 'test.xlsx')) as fp:
headers, data = xlrd_tools.xlsx_xlrd(fp)
assert headers[0] == {'field': 'one', 'id': 'one', 'name': 'one'}
assert headers[... | 40.9375 | 86 | 0.561832 | import os
from ..libs import xlrd_tools
HERE = os.path.dirname(os.path.abspath(__file__))
def test_xlsx_xlrd():
with open(os.path.join(HERE, 'fixtures', 'test.xlsx')) as fp:
headers, data = xlrd_tools.xlsx_xlrd(fp)
assert headers[0] == {'field': 'one', 'id': 'one', 'name': 'one'}
assert headers[... | true | true |
1c1275cbb5d2fb09c3d3933f420a2a48859df21f | 49,891 | py | Python | torchvision/transforms/transforms.py | qilei123/vision2 | e62f8cc0030b4d0943b818759c6bf99dae7f2694 | [
"BSD-3-Clause"
] | null | null | null | torchvision/transforms/transforms.py | qilei123/vision2 | e62f8cc0030b4d0943b818759c6bf99dae7f2694 | [
"BSD-3-Clause"
] | null | null | null | torchvision/transforms/transforms.py | qilei123/vision2 | e62f8cc0030b4d0943b818759c6bf99dae7f2694 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division
import torch
import math
import sys
import random
from PIL import Image
try:
import accimage
except ImportError:
accimage = None
import numpy as np
import numbers
import types
import collections
import warnings
from . import functional as F
if sys.version_info < (3, 3):
Seq... | 37.682024 | 126 | 0.605159 | from __future__ import division
import torch
import math
import sys
import random
from PIL import Image
try:
import accimage
except ImportError:
accimage = None
import numpy as np
import numbers
import types
import collections
import warnings
from . import functional as F
if sys.version_info < (3, 3):
Seq... | true | true |
1c1275d60387d67acfdc3c4112cb73b59b8e601a | 3,129 | py | Python | vaserving/arguments.py | leopck/video-analytics-serving | 9cbf744661a876a53098614ce84b4e0199fb9109 | [
"BSD-3-Clause"
] | null | null | null | vaserving/arguments.py | leopck/video-analytics-serving | 9cbf744661a876a53098614ce84b4e0199fb9109 | [
"BSD-3-Clause"
] | null | null | null | vaserving/arguments.py | leopck/video-analytics-serving | 9cbf744661a876a53098614ce84b4e0199fb9109 | [
"BSD-3-Clause"
] | null | null | null | '''
* Copyright (C) 2019-2020 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
'''
import os
import argparse
import json
import distutils.util as util
def parse_options(args=None):
parser = argparse.ArgumentParser(fromfile_prefix_chars='@',
formatter_class=argpars... | 44.070423 | 95 | 0.567913 | import os
import argparse
import json
import distutils.util as util
def parse_options(args=None):
parser = argparse.ArgumentParser(fromfile_prefix_chars='@',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--port", action="store", type=int,
... | true | true |
1c127632744e9aa61569a3c62e568f8750a503bb | 669 | py | Python | face.py | nonylene/tf-yuruyuri | 14307a19af5fffb2eda3f8b51af5d0bb550dd959 | [
"Apache-2.0"
] | 3 | 2016-06-22T22:35:24.000Z | 2016-07-11T12:30:40.000Z | face.py | nonylene/tf-yuruyuri | 14307a19af5fffb2eda3f8b51af5d0bb550dd959 | [
"Apache-2.0"
] | null | null | null | face.py | nonylene/tf-yuruyuri | 14307a19af5fffb2eda3f8b51af5d0bb550dd959 | [
"Apache-2.0"
] | null | null | null | import peewee
from os import path
db = peewee.SqliteDatabase(path.join(path.abspath(path.dirname(__file__)), 'main.db'))
class Face(peewee.Model):
story = peewee.IntegerField(null = False)
pic_path = peewee.TextField(null = False, index = True)
x = peewee.IntegerField(null = False)
y = peewee.Integer... | 31.857143 | 86 | 0.692078 | import peewee
from os import path
db = peewee.SqliteDatabase(path.join(path.abspath(path.dirname(__file__)), 'main.db'))
class Face(peewee.Model):
story = peewee.IntegerField(null = False)
pic_path = peewee.TextField(null = False, index = True)
x = peewee.IntegerField(null = False)
y = peewee.Integer... | true | true |
1c12768af5c72422b4a946809093642dbc5dbd46 | 3,611 | py | Python | tfx/orchestration/config/config_utils_test.py | alonsoir/tfx | 359dcc95e6104e183b685a683d502744305e5eba | [
"Apache-2.0"
] | 1 | 2021-10-04T21:53:34.000Z | 2021-10-04T21:53:34.000Z | tfx/orchestration/config/config_utils_test.py | alonsoir/tfx | 359dcc95e6104e183b685a683d502744305e5eba | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/config/config_utils_test.py | alonsoir/tfx | 359dcc95e6104e183b685a683d502744305e5eba | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019 Google LLC. 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 ... | 40.122222 | 80 | 0.772639 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tfx import types
from tfx.components.base import executor_spec
from tfx.orchestration.config import config_utils
from tfx.orchestration.config import docker_component_config
from t... | true | true |
1c12780542508b694b8a36516769774a86e87598 | 10,689 | py | Python | wemake_python_styleguide/visitors/ast/complexity/counts.py | cmppoon/wemake-python-styleguide | 335cff17a11fd764160fc6300d5c22d961b9ac37 | [
"MIT"
] | 1 | 2019-01-31T00:06:43.000Z | 2019-01-31T00:06:43.000Z | wemake_python_styleguide/visitors/ast/complexity/counts.py | cmppoon/wemake-python-styleguide | 335cff17a11fd764160fc6300d5c22d961b9ac37 | [
"MIT"
] | 1 | 2019-10-09T16:57:12.000Z | 2019-10-09T16:57:12.000Z | wemake_python_styleguide/visitors/ast/complexity/counts.py | raghav-ys/wemake-python-styleguide | edb4a88923205448b29972ad0bc2862df5a569c5 | [
"MIT"
] | 1 | 2019-12-12T19:18:58.000Z | 2019-12-12T19:18:58.000Z | # -*- coding: utf-8 -*-
import ast
from collections import defaultdict
from typing import ClassVar, DefaultDict, List, Union
from typing_extensions import final
from wemake_python_styleguide.constants import MAX_LEN_YIELD_TUPLE
from wemake_python_styleguide.logic.functions import is_method
from wemake_python_stylegu... | 31.346041 | 80 | 0.633361 |
import ast
from collections import defaultdict
from typing import ClassVar, DefaultDict, List, Union
from typing_extensions import final
from wemake_python_styleguide.constants import MAX_LEN_YIELD_TUPLE
from wemake_python_styleguide.logic.functions import is_method
from wemake_python_styleguide.logic.nodes import g... | true | true |
1c1279039c4eebc77bcb5dcad84a71ef97a027db | 4,891 | py | Python | allauth/socialaccount/providers/draugiem/tests.py | mina-gaid/scp-stock-forcasting | 38e1cd303d4728a987df117f666ce194e241ed1a | [
"MIT"
] | 1 | 2018-04-06T21:36:59.000Z | 2018-04-06T21:36:59.000Z | allauth/socialaccount/providers/draugiem/tests.py | mina-gaid/scp-stock-forcasting | 38e1cd303d4728a987df117f666ce194e241ed1a | [
"MIT"
] | null | null | null | allauth/socialaccount/providers/draugiem/tests.py | mina-gaid/scp-stock-forcasting | 38e1cd303d4728a987df117f666ce194e241ed1a | [
"MIT"
] | null | null | null | from hashlib import md5
from django.contrib.auth.models import User
from django.utils.http import urlencode
from allauth.compat import reverse
from allauth.socialaccount import providers
from allauth.socialaccount.models import SocialToken, SocialApp
from allauth.utils import get_current_site
from allauth.tests impor... | 39.128 | 79 | 0.558986 | from hashlib import md5
from django.contrib.auth.models import User
from django.utils.http import urlencode
from allauth.compat import reverse
from allauth.socialaccount import providers
from allauth.socialaccount.models import SocialToken, SocialApp
from allauth.utils import get_current_site
from allauth.tests impor... | true | true |
1c1279d47f52163b9e2bc42a85d4e65d21f0a755 | 525 | py | Python | other/dingding/dingtalk/api/rest/OapiEduSubjectMetadataListRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiEduSubjectMetadataListRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiEduSubjectMetadataListRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2020.10.14
'''
from dingtalk.api.base import RestApi
class OapiEduSubjectMetadataListRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.area_code = None
self.cursor = None
self.data_order_type = None
self.level = None
self.operator_userid = None
self... | 22.826087 | 50 | 0.742857 | from dingtalk.api.base import RestApi
class OapiEduSubjectMetadataListRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.area_code = None
self.cursor = None
self.data_order_type = None
self.level = None
self.operator_userid = None
self.parent_id = None
self.period_code = Non... | true | true |
1c127b855cfcb43c2bc2d7b09ab92d7242189a69 | 4,393 | py | Python | parse_berlinale.py | Zverik/parse_berlinale | 9a60a4fe70c6c37fba24995ae64e5cd7d63a8063 | [
"BSD-2-Clause"
] | null | null | null | parse_berlinale.py | Zverik/parse_berlinale | 9a60a4fe70c6c37fba24995ae64e5cd7d63a8063 | [
"BSD-2-Clause"
] | null | null | null | parse_berlinale.py | Zverik/parse_berlinale | 9a60a4fe70c6c37fba24995ae64e5cd7d63a8063 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import bs4
import requests
import time
import json
import re
import sys
BASE_URL = 'https://www.berlinale.de'
URL = f'{BASE_URL}/en/programme/programme/berlinale-programme.html'
RE_FILM_ID = re.compile(r'film_id=(\d+)')
RE_COUNTRY_YEAR = re.compile(r'(.+?)\s+(\d{4})\s*')
RE_TCODE = re.compile(r... | 33.280303 | 86 | 0.59959 | import bs4
import requests
import time
import json
import re
import sys
BASE_URL = 'https://www.berlinale.de'
URL = f'{BASE_URL}/en/programme/programme/berlinale-programme.html'
RE_FILM_ID = re.compile(r'film_id=(\d+)')
RE_COUNTRY_YEAR = re.compile(r'(.+?)\s+(\d{4})\s*')
RE_TCODE = re.compile(r'\d{4,8}')
YEAR = 2020
... | true | true |
1c127cfebee5df682f9baed8de15c9ad0e5ef069 | 2,629 | py | Python | test/pyaz/monitor/autoscale/profile/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/monitor/autoscale/profile/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/monitor/autoscale/profile/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from .... pyaz_utils import get_cli_name, get_params
def create(autoscale_name, resource_group, name, count, timezone, start=None, end=None, copy_rules=None, min_count=None, max_count=None, recurrence=None):
params = get_params(locals())
command = "az monitor autoscale profile creat... | 35.527027 | 154 | 0.672119 | import json, subprocess
from .... pyaz_utils import get_cli_name, get_params
def create(autoscale_name, resource_group, name, count, timezone, start=None, end=None, copy_rules=None, min_count=None, max_count=None, recurrence=None):
params = get_params(locals())
command = "az monitor autoscale profile creat... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.