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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73253edbec788340fa63d923f7d8dd39807876f | 24,052 | py | Python | research/syntaxnet/dragnn/python/transformer_units.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/syntaxnet/dragnn/python/transformer_units.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/syntaxnet/dragnn/python/transformer_units.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 41.11453 | 81 | 0.61866 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from dragnn.python import network_units
def add_timing_signal_1d(x, min_timescale=1.0, max_timescale=1.0e4):
length = tf.shape(x)[1]
channels = ... | true | true |
f732540c032f69259ef86b76fd0153508799d6e2 | 4,475 | py | Python | scripts/grid_search.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | 58 | 2018-05-17T03:48:05.000Z | 2020-12-20T20:39:55.000Z | scripts/grid_search.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | 5 | 2018-05-17T01:58:08.000Z | 2020-12-16T18:38:05.000Z | scripts/grid_search.py | shamirtowsif/soft_patterns | bd0b3d4cb46e49ad36f39b3a1d6f369da7e8ad6e | [
"MIT"
] | 10 | 2018-06-08T20:18:20.000Z | 2021-06-06T17:44:38.000Z | #!/usr/bin/env python
import sys
import os
import os.path
import copy
import subprocess
from operator import mul
from random import shuffle
from operator import mul
from functools import reduce
dirs=['stanford_sentiment_binary', 'amazon_reviews', 'ROC_stories', 'stanford_sentiment_binary_100',
'stanford_sentimen... | 31.076389 | 132 | 0.667486 |
import sys
import os
import os.path
import copy
import subprocess
from operator import mul
from random import shuffle
from operator import mul
from functools import reduce
dirs=['stanford_sentiment_binary', 'amazon_reviews', 'ROC_stories', 'stanford_sentiment_binary_100',
'stanford_sentiment_binary_500', 'stanfor... | true | true |
f732550aa5d382fb0ee404be3464702f9e7a57b7 | 2,722 | py | Python | examples/node_classification.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | examples/node_classification.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | examples/node_classification.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | import yaml
import random
import torch.backends.cudnn
import numpy as np
from autogl.datasets import build_dataset_from_name
from autogl.solver import AutoNodeClassifier
from autogl.module import Acc
from autogl.backend import DependentBackend
if __name__ == "__main__":
from argparse import ArgumentParser, Argume... | 32.404762 | 81 | 0.64144 | import yaml
import random
import torch.backends.cudnn
import numpy as np
from autogl.datasets import build_dataset_from_name
from autogl.solver import AutoNodeClassifier
from autogl.module import Acc
from autogl.backend import DependentBackend
if __name__ == "__main__":
from argparse import ArgumentParser, Argume... | true | true |
f732557435b6dc4f0046e12a67a471a54ffca701 | 982 | py | Python | mysite/mysite/urls.py | BAXTOR95/blog_project | a167c9f63a33a5075a001de29720a58624fd1636 | [
"MIT"
] | 1 | 2021-03-30T07:51:30.000Z | 2021-03-30T07:51:30.000Z | mysite/mysite/urls.py | BAXTOR95/blog_project | a167c9f63a33a5075a001de29720a58624fd1636 | [
"MIT"
] | null | null | null | mysite/mysite/urls.py | BAXTOR95/blog_project | a167c9f63a33a5075a001de29720a58624fd1636 | [
"MIT"
] | 1 | 2021-01-16T13:48:39.000Z | 2021-01-16T13:48:39.000Z | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 36.37037 | 77 | 0.690428 | from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('blog.urls')),
path('accounts/login/', views.login, name='login'),
path('accounts/logout/', views.logout,
name='logout'... | true | true |
f73255f453208be5b49bcb21a383512d9ef8a752 | 6,524 | py | Python | rasa/engine/training/components.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 3,603 | 2017-05-21T18:34:55.000Z | 2019-04-16T11:58:09.000Z | rasa/engine/training/components.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 2,782 | 2017-05-21T20:36:15.000Z | 2019-04-16T14:35:20.000Z | rasa/engine/training/components.py | Next-Trends/rasa | c06dc26b3a57dd1114b60aebcc9ccd3bbb8308d7 | [
"Apache-2.0"
] | 1,337 | 2017-05-21T18:10:33.000Z | 2019-04-16T09:14:42.000Z | from __future__ import annotations
from typing import Any, Dict, Optional, Text, Type
import dataclasses
import uuid
from rasa.engine.caching import Cacheable, TrainingCache
from rasa.engine.graph import ExecutionContext, GraphComponent, SchemaNode
from rasa.engine.storage.resource import Resource
from rasa.engine.sto... | 36.858757 | 88 | 0.667689 | from __future__ import annotations
from typing import Any, Dict, Optional, Text, Type
import dataclasses
import uuid
from rasa.engine.caching import Cacheable, TrainingCache
from rasa.engine.graph import ExecutionContext, GraphComponent, SchemaNode
from rasa.engine.storage.resource import Resource
from rasa.engine.sto... | true | true |
f732568bc73bb8b78f184a2659fa83180b3c902d | 367 | py | Python | 10420/10420.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null | 10420/10420.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null | 10420/10420.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null | import sys
n = int(sys.stdin.readline())
countries = {}
for _ in range(n):
country = sys.stdin.readline().split()[0]
#Add to the current value (or 0 if not present)
countries[country] = countries.get(country, 0) + 1
#Order keys alphabetically
keys = sorted(countries.keys())
for k in key... | 20.388889 | 55 | 0.623978 | import sys
n = int(sys.stdin.readline())
countries = {}
for _ in range(n):
country = sys.stdin.readline().split()[0]
countries[country] = countries.get(country, 0) + 1
keys = sorted(countries.keys())
for k in keys:
print('{} {}'.format(k,countries[k]))
| true | true |
f73256e3b561a6f89abbc2dc5ccfdde8a6475f77 | 1,135 | py | Python | portia_server/portia_dashboard/tasks.py | rmdes/portia-dashboard | 97e698c7232c15eff47d20fd3529251bbd284226 | [
"BSD-3-Clause"
] | 223 | 2018-01-22T07:43:58.000Z | 2022-03-25T12:52:30.000Z | portia_server/portia_dashboard/tasks.py | rmdes/portia-dashboard | 97e698c7232c15eff47d20fd3529251bbd284226 | [
"BSD-3-Clause"
] | 9 | 2018-03-17T15:16:26.000Z | 2019-11-11T09:35:04.000Z | portia_server/portia_dashboard/tasks.py | rmdes/portia-dashboard | 97e698c7232c15eff47d20fd3529251bbd284226 | [
"BSD-3-Clause"
] | 76 | 2018-01-22T04:20:00.000Z | 2021-11-13T09:53:26.000Z | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from .models import Schedule
from celery.task.schedules import crontab
from celery import shared_task
from celery import task
import logging
import time, datetime
import requests
logger = logging.getLogger('portia_dashboard')
... | 31.527778 | 125 | 0.663436 | from __future__ import absolute_import, unicode_literals
from django.conf import settings
from .models import Schedule
from celery.task.schedules import crontab
from celery import shared_task
from celery import task
import logging
import time, datetime
import requests
logger = logging.getLogger('portia_dashboard')
... | true | true |
f7325868460a157150006054167b4d86c914b192 | 2,535 | py | Python | setup.py | uwbmrb/PyNMRSTAR | c6e3cdccb4aa44dfbc3b4e984837a6bcde3cf171 | [
"MIT"
] | 16 | 2017-02-02T05:00:50.000Z | 2021-05-25T11:13:15.000Z | setup.py | uwbmrb/PyNMRSTAR | c6e3cdccb4aa44dfbc3b4e984837a6bcde3cf171 | [
"MIT"
] | 29 | 2016-07-14T21:02:18.000Z | 2021-06-26T17:24:07.000Z | setup.py | bmrb-io/PyNMRSTAR | 55df5bf7de192e7a6c95f37e0756f09e3f504170 | [
"MIT"
] | 4 | 2016-04-14T16:29:49.000Z | 2017-02-28T02:01:57.000Z | #!/usr/bin/env python3
import os
from setuptools import setup, Extension
def get_version():
internal_file_location = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'pynmrstar', '_internal.py')
with open(internal_file_location, 'r') as internal_file:
for line in internal_file:
i... | 39.609375 | 116 | 0.586588 |
import os
from setuptools import setup, Extension
def get_version():
internal_file_location = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'pynmrstar', '_internal.py')
with open(internal_file_location, 'r') as internal_file:
for line in internal_file:
if line.startswith('__ve... | true | true |
f73258eae4d5169d7051cca79bea9e0c5febac33 | 20 | py | Python | upconvert/parser/t/__init__.py | lehaianh1986/schematic-file-converter | ed67274511a5b0e1b378e4e0fd3943ec8a189f43 | [
"Apache-2.0"
] | 29 | 2016-05-19T02:04:51.000Z | 2021-09-16T06:25:59.000Z | upconvert/parser/t/__init__.py | 84ace/schematic-file-converter | a5975a521d842396605c05a9f197bfe088906bb4 | [
"Apache-2.0"
] | null | null | null | upconvert/parser/t/__init__.py | 84ace/schematic-file-converter | a5975a521d842396605c05a9f197bfe088906bb4 | [
"Apache-2.0"
] | 24 | 2016-05-19T02:05:00.000Z | 2022-01-14T18:20:01.000Z | """ Parser tests """ | 20 | 20 | 0.55 | true | true | |
f732596a48cb52363db0bf4dd853807f96f22319 | 4,315 | py | Python | benchmarks/image_recognition/tensorflow_serving/inceptionv3/inference/fp32/image_recognition_benchmark.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | benchmarks/image_recognition/tensorflow_serving/inceptionv3/inference/fp32/image_recognition_benchmark.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | benchmarks/image_recognition/tensorflow_serving/inceptionv3/inference/fp32/image_recognition_benchmark.py | hekaplex/resnet_dl | fc8d4dcc0adffbe22d01d333e6cf5db955f2f011 | [
"Apache-2.0"
] | null | null | null | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Intel Corporation
#
# 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 requ... | 35.958333 | 112 | 0.672074 |
from __future__ import print_function
import os
import random
import grpc
import numpy as np
import sys
import tensorflow as tf
import tensorflow.compat.v1 as tf_v1
import time
from tensorflow_serving.apis import predict_pb2
from tensorflow_serving.apis import prediction_service_pb2_grpc
from util ... | true | true |
f7325b9e40c3db2e572ba5e1f7ec33a8559aa03b | 18,306 | py | Python | fattureincloud_python_sdk/model/permissions.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | 2 | 2022-02-17T08:33:17.000Z | 2022-03-22T09:27:00.000Z | fattureincloud_python_sdk/model/permissions.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | fattureincloud_python_sdk/model/permissions.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | """
Fatture in Cloud API v2 - API Reference
Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. # noq... | 50.709141 | 278 | 0.60106 |
import re import sys
from fattureincloud_python_sdk.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_inf... | true | true |
f7325bdb93b55decc83345de041763385b298627 | 847 | py | Python | arboretum_project/arboretum_project/urls.py | m-libbrecht/django-arboretum | 11b97254ed9885b03d25d99188157c3f79a14a4f | [
"MIT"
] | null | null | null | arboretum_project/arboretum_project/urls.py | m-libbrecht/django-arboretum | 11b97254ed9885b03d25d99188157c3f79a14a4f | [
"MIT"
] | null | null | null | arboretum_project/arboretum_project/urls.py | m-libbrecht/django-arboretum | 11b97254ed9885b03d25d99188157c3f79a14a4f | [
"MIT"
] | null | null | null | """arboretum URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | 30.25 | 77 | 0.700118 |
from django.conf.urls import include, url
from django.contrib import admin
from demoapp.views import TreeView
urlpatterns = [
url(r'^$', TreeView.as_view(), name='home'),
url(r'^admin/', include(admin.site.urls)),
]
| true | true |
f7325c79a928bd9ff8953a9a81a3e2e12fa93031 | 855 | py | Python | python3-virtualenv/lib/python3.8/site-packages/setuptools/command/bdist_rpm.py | bbalkaransingh23888/OrientationHack | 7eae6cce1226112c000ea8a175f6dc5a82ee0ac2 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.8/site-packages/setuptools/command/bdist_rpm.py | bbalkaransingh23888/OrientationHack | 7eae6cce1226112c000ea8a175f6dc5a82ee0ac2 | [
"MIT"
] | null | null | null | python3-virtualenv/lib/python3.8/site-packages/setuptools/command/bdist_rpm.py | bbalkaransingh23888/OrientationHack | 7eae6cce1226112c000ea8a175f6dc5a82ee0ac2 | [
"MIT"
] | null | null | null | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | 29.482759 | 75 | 0.617544 | import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
def run(self):
self.run_command("egg_info")
orig.bdist_rpm.run(self)
def _make_spec_file(self):
spec = orig.bdist_rpm._make_spec_file(self)
spec = [
line.replace(
... | true | true |
f7325c9bd6d6204726d8f2c239e94b0f13af7be3 | 83,032 | py | Python | purestorage/purestorage.py | kjetijor/rest-client | 43934a78e95e9719584a66189e4c4851eeb9ebaf | [
"BSD-2-Clause"
] | null | null | null | purestorage/purestorage.py | kjetijor/rest-client | 43934a78e95e9719584a66189e4c4851eeb9ebaf | [
"BSD-2-Clause"
] | null | null | null | purestorage/purestorage.py | kjetijor/rest-client | 43934a78e95e9719584a66189e4c4851eeb9ebaf | [
"BSD-2-Clause"
] | null | null | null | """
This library provides an easy way to script administration tasks for the
Pure Storage FlashArray.
When passing arguments to methods that take \*\*kwargs, the exact
parameters that can be passed can be found in the REST API guide for the
given release of Purity running on the FlashArray.
"""
import json
import req... | 32.207913 | 91 | 0.589989 |
import json
import requests
from distutils.version import LooseVersion
VERSION = "1.11.3"
class FlashArray(object):
supported_rest_versions = [
"1.11",
"1.10",
"1.9",
"1.8",
"1.7",
"1.6",
"1.5",
"1.4",
... | true | true |
f7325d5471f3864ebbc211b12867d82ff5de718c | 1,304 | py | Python | web_test/assist/selene/shared/hook.py | yashaka/selene-pytest-template | 12ed37ac5970f415c61cae50d03c62a7d31975fa | [
"MIT"
] | null | null | null | web_test/assist/selene/shared/hook.py | yashaka/selene-pytest-template | 12ed37ac5970f415c61cae50d03c62a7d31975fa | [
"MIT"
] | null | null | null | web_test/assist/selene/shared/hook.py | yashaka/selene-pytest-template | 12ed37ac5970f415c61cae50d03c62a7d31975fa | [
"MIT"
] | null | null | null | import allure
from selene.core.exceptions import TimeoutException
from selene.support.shared import browser
def attach_snapshots_on_failure(error: TimeoutException) -> Exception:
"""
An example of selene hook_wait_failure that attaches snapshots to failed test step.
It is actually might not needed,
be... | 37.257143 | 87 | 0.696319 | import allure
from selene.core.exceptions import TimeoutException
from selene.support.shared import browser
def attach_snapshots_on_failure(error: TimeoutException) -> Exception:
last_screenshot = browser.config.last_screenshot
if last_screenshot:
allure.attach.file(source=last_screenshot,
... | true | true |
f7325e38e6b3e37a43fb029d0d2a6c0bc984703c | 1,956 | py | Python | experiments/Scripts for creating plots/sac_performance_over_generations.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | experiments/Scripts for creating plots/sac_performance_over_generations.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | experiments/Scripts for creating plots/sac_performance_over_generations.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
x=np.arange(50)
y=np.array([-59.00138158129509,
-43.966695525591895,
-52.5277642686108,
-32.1793153104166,
-37.81484603001339,
-24.97787027415733,... | 33.152542 | 37 | 0.463701 | import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
x=np.arange(50)
y=np.array([-59.00138158129509,
-43.966695525591895,
-52.5277642686108,
-32.1793153104166,
-37.81484603001339,
-24.97787027415733,... | true | true |
f7325e94e83568ba3af3aaa3e3f4c4a03332c471 | 1,351 | py | Python | contract.py | wxz52155/OpenFarmerOnAnchor | c089f0955cc4041818a64e01e3f13e5337ddd396 | [
"Apache-2.0"
] | null | null | null | contract.py | wxz52155/OpenFarmerOnAnchor | c089f0955cc4041818a64e01e3f13e5337ddd396 | [
"Apache-2.0"
] | null | null | null | contract.py | wxz52155/OpenFarmerOnAnchor | c089f0955cc4041818a64e01e3f13e5337ddd396 | [
"Apache-2.0"
] | 1 | 2022-01-21T04:09:52.000Z | 2022-01-21T04:09:52.000Z | import datetime as dt
from requests import HTTPError
import eospy.cleos
import eospy.keys
import pytz
from settings import user_param
def push_transaction(params_json):
# this url is to a testnet that may or may not be working.
# We suggest using a different testnet such as kylin or jungle
#
ce = eosp... | 33.775 | 83 | 0.679497 | import datetime as dt
from requests import HTTPError
import eospy.cleos
import eospy.keys
import pytz
from settings import user_param
def push_transaction(params_json):
ce = eospy.cleos.Cleos(url=user_param.rpc_domain)
arguments = params_json['actions'][0]['data']
payload = {
"account... | true | true |
f7325f7757fea1fb00807643e7b1200d995cc928 | 2,142 | py | Python | setup.py | harrymvr/absorbing-centrality | d143e5bfe042dc863da28851448f2b811ed45c68 | [
"0BSD"
] | 19 | 2015-09-03T12:38:40.000Z | 2021-01-06T09:38:27.000Z | setup.py | harrymvr/absorbing-centrality | d143e5bfe042dc863da28851448f2b811ed45c68 | [
"0BSD"
] | 2 | 2015-09-01T15:08:14.000Z | 2015-11-16T13:38:36.000Z | setup.py | harrymvr/absorbing-centrality | d143e5bfe042dc863da28851448f2b811ed45c68 | [
"0BSD"
] | 5 | 2015-10-09T22:03:59.000Z | 2018-05-25T08:32:32.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import, print_function
import io
import os
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import relpath
from os.path import splitext
from setuptools import f... | 31.970149 | 116 | 0.641457 | from __future__ import absolute_import, print_function
import io
import os
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import relpath
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
def r... | true | true |
f7325fa0e342ce06f43789c08ccef69fbef643ab | 14,935 | py | Python | src/sage/misc/memory_info.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/misc/memory_info.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/misc/memory_info.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 7 | 2021-11-08T10:01:59.000Z | 2022-03-03T11:25:52.000Z | """
Information about available RAM/swap
There is no portable way to figure these out, nor should you generally
have to. But GAP currently needs to allocate a cache of fixed size
upon startup, and we would like a certain fraction of the swap address
space.
EXAMPLES::
sage: from sage.misc.memory_info import Memor... | 28.666027 | 108 | 0.566856 |
from sage.misc.superseded import deprecation
deprecation(21805, "the module sage.misc.memory_info is deprecated, use the psutil package instead.")
import subprocess
from sys import maxsize
from sage.structure.sage_object import SageObject
memory_info_instance = None
def MemoryInfo():
global memory_info_instan... | true | true |
f73260433b527d8ba6321087e688077524d361a8 | 3,993 | py | Python | tests/integ/test_ntm.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | 1 | 2021-12-10T16:18:29.000Z | 2021-12-10T16:18:29.000Z | tests/integ/test_ntm.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | 20 | 2021-09-17T20:50:11.000Z | 2021-12-09T00:29:02.000Z | tests/integ/test_ntm.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 38.394231 | 99 | 0.717506 | from __future__ import absolute_import
import os
import numpy as np
import pytest
from sagemaker import NTM, NTMModel, Predictor
from sagemaker.amazon.common import read_records
from sagemaker.serverless import ServerlessInferenceConfig
from sagemaker.utils import unique_name_from_base
from tests.integ import DATA_D... | true | true |
f7326090f8bedc0b5a1973fcdc6eeb702c6723dc | 4,197 | py | Python | adeft/tests/test_disambiguate.py | johnbachman/deft | 3643dd33ba4cb548f7622f24a3b87fbe48e38050 | [
"BSD-2-Clause"
] | null | null | null | adeft/tests/test_disambiguate.py | johnbachman/deft | 3643dd33ba4cb548f7622f24a3b87fbe48e38050 | [
"BSD-2-Clause"
] | null | null | null | adeft/tests/test_disambiguate.py | johnbachman/deft | 3643dd33ba4cb548f7622f24a3b87fbe48e38050 | [
"BSD-2-Clause"
] | null | null | null | import os
import uuid
import json
import shutil
import logging
from nose.tools import raises
from numpy import array_equal
from adeft.modeling.classify import load_model
from adeft.locations import TEST_RESOURCES_PATH
from adeft.disambiguate import AdeftDisambiguator, load_disambiguator
logger = logging.getLogger(__... | 38.154545 | 78 | 0.679295 | import os
import uuid
import json
import shutil
import logging
from nose.tools import raises
from numpy import array_equal
from adeft.modeling.classify import load_model
from adeft.locations import TEST_RESOURCES_PATH
from adeft.disambiguate import AdeftDisambiguator, load_disambiguator
logger = logging.getLogger(__... | true | true |
f73260e91d1ae454fee4867788ff917e7a7743be | 22,733 | py | Python | python/venv/lib/python2.7/site-packages/openstackclient/tests/volume/v1/test_volume.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | python/venv/lib/python2.7/site-packages/openstackclient/tests/volume/v1/test_volume.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | python/venv/lib/python2.7/site-packages/openstackclient/tests/volume/v1/test_volume.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | # Copyright 2013 Nebula Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 32.01831 | 78 | 0.5397 |
import copy
from openstackclient.tests import fakes
from openstackclient.tests.identity.v2_0 import fakes as identity_fakes
from openstackclient.tests.volume.v1 import fakes as volume_fakes
from openstackclient.volume.v1 import volume
class TestVolume(volume_fakes.TestVolumev1):
def setUp(self):
super(... | true | true |
f732611a1a2ab486119fd62c51262868f3c65886 | 920 | py | Python | isi_sdk_8_1_1/test/test_hdfs_racks_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/test/test_hdfs_racks_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/test/test_hdfs_racks_extended.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: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... | 22.439024 | 92 | 0.71087 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from isi_sdk_8_1_1.models.hdfs_racks_extended import HdfsRacksExtended from isi_sdk_8_1_1.rest import ApiException
class TestHdfsRacksExtended(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | true | true |
f73261dcada28847fe886f6d9f0b31bf935869e2 | 723 | py | Python | ckanext/example_iconfigurer/controller.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 2 | 2015-07-17T19:09:52.000Z | 2017-08-30T20:23:44.000Z | ckanext/example_iconfigurer/controller.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 12 | 2015-01-19T18:03:56.000Z | 2016-04-11T16:40:33.000Z | ckanext/example_iconfigurer/controller.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 3 | 2015-03-31T06:19:42.000Z | 2016-06-27T15:32:28.000Z | import ckan.lib.base as base
import ckan.lib.helpers as helpers
render = base.render
class MyExtController(base.BaseController):
def config_one(self):
'''Render the config template with the first custom title.'''
return render('admin/myext_config.html',
extra_vars={'title'... | 31.434783 | 74 | 0.662517 | import ckan.lib.base as base
import ckan.lib.helpers as helpers
render = base.render
class MyExtController(base.BaseController):
def config_one(self):
return render('admin/myext_config.html',
extra_vars={'title': 'My First Config Page'})
def config_two(self):
return r... | true | true |
f73261fd8815ad358fea1b0a2e1346d8c7efae13 | 4,929 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/lacp/get.py | CiscoTestAutomation/genielibs | becee8a1a85f4973e00859e3244e2c8fe45a394c | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/lacp/get.py | patrickboertje/genielibs | 61c37aacf3dd0f499944555e4ff940f92f53dacb | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/lacp/get.py | patrickboertje/genielibs | 61c37aacf3dd0f499944555e4ff940f92f53dacb | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | # Python
import logging
# Genie
from genie.metaparser.util.exceptions import SchemaEmptyParserError
log = logging.getLogger(__name__)
def get_lacp_member(device, port_channel, count, member, intf_list, internal=False):
""" This API parse's 'show lacp internal/neighbor' commands and return requested member
... | 37.625954 | 109 | 0.571313 | import logging
from genie.metaparser.util.exceptions import SchemaEmptyParserError
log = logging.getLogger(__name__)
def get_lacp_member(device, port_channel, count, member, intf_list, internal=False):
if (internal == True):
out = device.parse("show lacp internal")
else:
out = device.parse("s... | true | true |
f7326241d185da508ae499d8b06d8fa4296a28b9 | 1,626 | py | Python | lite/tests/unittest_py/op/backends/x86/test_gelu_op.py | laiou/Paddle-Lite | a99080a48186ec7df546d77d39db58d84d1dda3e | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/op/backends/x86/test_gelu_op.py | laiou/Paddle-Lite | a99080a48186ec7df546d77d39db58d84d1dda3e | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/op/backends/x86/test_gelu_op.py | laiou/Paddle-Lite | a99080a48186ec7df546d77d39db58d84d1dda3e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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... | 33.875 | 125 | 0.741697 |
import sys
sys.path.append('../../common')
sys.path.append('../../../')
import test_gelu_op_base
from auto_scan_test import AutoScanTest, IgnoreReasons
from program_config import TensorConfig, ProgramConfig, OpConfig, CxxConfig, TargetType, PrecisionType, DataLayoutType, Place
import unittest
import hypothesis
from ... | true | true |
f7326364052f70b968fe2f687a12024f1f20264d | 1,057 | py | Python | agent/indy_catalyst_agent/messaging/connections/messages/connection_response.py | mikelodder7/indy-catalyst | 5e80d8d6764144303b7ef1851aee32291bcb2d98 | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/messaging/connections/messages/connection_response.py | mikelodder7/indy-catalyst | 5e80d8d6764144303b7ef1851aee32291bcb2d98 | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/messaging/connections/messages/connection_response.py | mikelodder7/indy-catalyst | 5e80d8d6764144303b7ef1851aee32291bcb2d98 | [
"Apache-2.0"
] | null | null | null | """
Represents a connection response message
"""
from marshmallow import fields
from ...agent_message import AgentMessage, AgentMessageSchema
from ..message_types import CONNECTION_RESPONSE
from ....models.connection_detail import ConnectionDetail, ConnectionDetailSchema
HANDLER_CLASS = (
"indy_catalyst_agent.me... | 25.166667 | 81 | 0.717124 |
from marshmallow import fields
from ...agent_message import AgentMessage, AgentMessageSchema
from ..message_types import CONNECTION_RESPONSE
from ....models.connection_detail import ConnectionDetail, ConnectionDetailSchema
HANDLER_CLASS = (
"indy_catalyst_agent.messaging.connections.handlers."
+ "connection_... | true | true |
f73263c4c1df5dfb8107b488aaa76084d7b77bb6 | 1,842 | py | Python | loadgen/setup.py | sf-wind/inference | ae7fa59ce55cd68dfd474149df417557a69704a9 | [
"Apache-2.0"
] | null | null | null | loadgen/setup.py | sf-wind/inference | ae7fa59ce55cd68dfd474149df417557a69704a9 | [
"Apache-2.0"
] | null | null | null | loadgen/setup.py | sf-wind/inference | ae7fa59ce55cd68dfd474149df417557a69704a9 | [
"Apache-2.0"
] | null | null | null | """MLPerf Inference LoadGen python bindings.
Creates a module that python can import.
All source files are compiled by python's C++ toolchain without depending
on a loadgen lib.
This setup.py can be used stand-alone, without the use of an external
build system. This will polute your source tree with output files
and... | 28.78125 | 76 | 0.698697 |
from setuptools import setup, Extension
from version_generator import generate_loadgen_version_definitions
generated_version_source_filename = "generated/version.cc"
generate_loadgen_version_definitions(generated_version_source_filename)
public_headers = [
"loadgen.h",
"query_sample.h",
"query_sample_library.h... | true | true |
f732658d5a149ab114e15ead4d028cafb022c2a4 | 18,700 | py | Python | models.py | zedian/esm | 9d2b50cd96753e8a703ca810e875c9e887047ed9 | [
"MIT"
] | null | null | null | models.py | zedian/esm | 9d2b50cd96753e8a703ca810e875c9e887047ed9 | [
"MIT"
] | null | null | null | models.py | zedian/esm | 9d2b50cd96753e8a703ca810e875c9e887047ed9 | [
"MIT"
] | null | null | null | from __future__ import print_function
import torch
from torch import nn
import torch.utils.data as Data
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import collections
import math
import copy
torch.manual_seed(1)
np.random.seed(1)
class BIN_Interaction_Flat(nn.Sequential):... | 42.596811 | 199 | 0.669144 | from __future__ import print_function
import torch
from torch import nn
import torch.utils.data as Data
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import collections
import math
import copy
torch.manual_seed(1)
np.random.seed(1)
class BIN_Interaction_Flat(nn.Sequential):... | true | true |
f73265c9edaae6ec1281e7f5b9116e4c14930790 | 3,488 | py | Python | oxasl/mask.py | ibme-qubic/oxasl | 8a0c055752d6e10cd932336ae6916f0c4fc0a2e9 | [
"Apache-2.0"
] | 1 | 2020-11-02T13:01:47.000Z | 2020-11-02T13:01:47.000Z | oxasl/mask.py | ibme-qubic/oxasl | 8a0c055752d6e10cd932336ae6916f0c4fc0a2e9 | [
"Apache-2.0"
] | 13 | 2019-01-14T13:22:00.000Z | 2020-09-12T20:34:20.000Z | oxasl/mask.py | physimals/oxasl | e583103f3313aed2890b60190b6ca7b265a46e3c | [
"Apache-2.0"
] | 3 | 2019-03-19T15:46:48.000Z | 2020-03-13T16:55:48.000Z | """
OXASL - Module to generate a suitable mask for ASL data
Copyright (c) 2008-2020 Univerisity of Oxford
"""
import numpy as np
import scipy as sp
import fsl.wrappers as fsl
from fsl.data.image import Image
from oxasl import reg
from oxasl.reporting import LightboxImage
def generate_mask(wsp):
"""
For comp... | 39.191011 | 151 | 0.675745 | import numpy as np
import scipy as sp
import fsl.wrappers as fsl
from fsl.data.image import Image
from oxasl import reg
from oxasl.reporting import LightboxImage
def generate_mask(wsp):
run(wsp)
def run(wsp):
if wsp.rois is not None and wsp.rois.mask is not None:
return
wsp.sub("rois")
wsp.... | true | true |
f7326634ece2f34cc1465b450f8505c188b6eaa4 | 1,769 | py | Python | src/gtk/toga_gtk/widgets/splitcontainer.py | saluk/toga | f8bea583c87642ad102776e1b58fd8bb9265b135 | [
"BSD-3-Clause"
] | null | null | null | src/gtk/toga_gtk/widgets/splitcontainer.py | saluk/toga | f8bea583c87642ad102776e1b58fd8bb9265b135 | [
"BSD-3-Clause"
] | null | null | null | src/gtk/toga_gtk/widgets/splitcontainer.py | saluk/toga | f8bea583c87642ad102776e1b58fd8bb9265b135 | [
"BSD-3-Clause"
] | null | null | null | from ..libs import Gtk
from ..window import GtkViewport
from .base import Widget
class SplitContainer(Widget):
def create(self):
# Use Paned widget rather than VPaned and HPaned deprecated widgets
# Note that orientation in toga behave unlike Gtk
if self.interface.VERTICAL:
sel... | 36.102041 | 80 | 0.654607 | from ..libs import Gtk
from ..window import GtkViewport
from .base import Widget
class SplitContainer(Widget):
def create(self):
if self.interface.VERTICAL:
self.native = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
elif self.interface.HORIZONTAL:
self.native =... | true | true |
f732667678fe56d63a50d6cdfc0a2bcc6b9ff02f | 5,812 | py | Python | lh/DecisionTree2.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | 3 | 2019-03-25T14:15:30.000Z | 2019-08-29T15:02:47.000Z | lh/DecisionTree2.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | null | null | null | lh/DecisionTree2.py | skyf0cker/Statistical_learning_method | 8151f3b8595ac086f08d161dc0cb961946f4b7fc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-02-03 15:17:08
# @Author : Vophan Lee (vophanlee@gmail.com)
# @Link : https://www.jianshu.com/u/3e6114e983ad
from sklearn.datasets import make_classification
import numpy as np
import math
class Decision_Tree(object):
"""
this i... | 41.219858 | 147 | 0.567275 |
from sklearn.datasets import make_classification
import numpy as np
import math
class Decision_Tree(object):
feature_list = []
gain_list = []
dim_list = []
index = 0
def __init__(self):
super(Decision_Tree, self).__init__()
self.features = 5
self.samples ... | true | true |
f7326756f8ad7832b4a6f8c87d9131cd0c7553a9 | 721 | py | Python | Bugscan_exploits-master/exp_list/exp-1063.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-1063.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-1063.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
#from:http://www.wooyun.org/bugs/wooyun-2010-093049
import re,time
def assign(service, arg):
if service == "umail":
return True, arg
def audit(arg):
url = arg + '/webmail/fast/index.php?module=operate&action=login'
postdata = 'mailbox=test@domain.com&link=?'
... | 34.333333 | 132 | 0.651872 | import re,time
def assign(service, arg):
if service == "umail":
return True, arg
def audit(arg):
url = arg + '/webmail/fast/index.php?module=operate&action=login'
postdata = 'mailbox=test@domain.com&link=?'
code, head, res, errcode, _ = curl.curl2(url,post=postdata)
if code =... | true | true |
f73267d55ff079ff1596cde36652108c05688ded | 2,752 | py | Python | DNN_HW5/main.py | jun-hyeok/SUP5001-41_Deep-Neural-Networks_2022Spring | 95bc0f3a7042debbc388c76d9bd43ad24aba2c88 | [
"MIT"
] | null | null | null | DNN_HW5/main.py | jun-hyeok/SUP5001-41_Deep-Neural-Networks_2022Spring | 95bc0f3a7042debbc388c76d9bd43ad24aba2c88 | [
"MIT"
] | null | null | null | DNN_HW5/main.py | jun-hyeok/SUP5001-41_Deep-Neural-Networks_2022Spring | 95bc0f3a7042debbc388c76d9bd43ad24aba2c88 | [
"MIT"
] | null | null | null | # %% [markdown]
# [](https://colab.research.google.com/github/jun-hyeok/SUP5001-41_Deep-Neural-Networks_2022Spring/blob/main/DNN_HW5/main.ipynb)
# %% [markdown]
# # DNN HW5 : #9
#
# 2022.03.23
# 박준혁
# %%
import numpy as np
import torch
import t... | 26.461538 | 202 | 0.579215 |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
x = torch.FloatTensor([[0, 0], [0, 1], [1, 0], [1, 1]])
y = torch.FloatTensor([[0], [1], [1], [0]])
class NN10(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Line... | true | true |
f732682b1cfe1fafeaca346811b06f346f04b564 | 22,189 | py | Python | virtual/lib/python3.6/site-packages/django/conf/global_settings.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 90 | 2017-08-24T18:57:21.000Z | 2022-03-04T01:58:56.000Z | virtual/lib/python3.6/site-packages/django/conf/global_settings.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 27 | 2017-04-01T15:06:36.000Z | 2021-02-08T20:19:58.000Z | virtual/lib/python3.6/site-packages/django/conf/global_settings.py | ngishjonathan/gallery | dd67f28887316d6277927c667f6641d26317b0b8 | [
"MIT"
] | 11 | 2019-02-26T14:30:28.000Z | 2021-12-31T05:04:08.000Z | # -*- coding: utf-8 -*-
"""
Default Django settings. Override these with settings in the module pointed to
by the DJANGO_SETTINGS_MODULE environment variable.
"""
from __future__ import unicode_literals
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module d... | 34.454969 | 103 | 0.703006 | from __future__ import unicode_literals
# django.utils.translation -- that module depends on the settings.
def gettext_noop(s):
return s
####################
# CORE #
####################
DEBUG = False
# Whether the framework should propagate raw exceptions rather than catching
# them. This is use... | true | true |
f732689a19695848c73536abbc88f78ed5fd6d88 | 8,182 | py | Python | tests/test_run.py | martinxyz/sacred | fa452e4eacf29caa59fb46c274a519669d6b4790 | [
"MIT"
] | 2 | 2016-10-24T10:26:03.000Z | 2016-10-31T15:22:13.000Z | tests/test_run.py | martinxyz/sacred | fa452e4eacf29caa59fb46c274a519669d6b4790 | [
"MIT"
] | 5 | 2016-10-22T15:46:11.000Z | 2017-06-29T11:19:11.000Z | tests/test_run.py | martinxyz/sacred | fa452e4eacf29caa59fb46c274a519669d6b4790 | [
"MIT"
] | 1 | 2020-04-11T14:44:42.000Z | 2020-04-11T14:44:42.000Z | #!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
from datetime import datetime
import mock
import os
import pytest
import tempfile
import sys
from sacred.run import Run
from sacred.config.config_summary import ConfigSummary
from sacred.utils import (ObserverError, ... | 29.861314 | 97 | 0.712173 | from __future__ import division, print_function, unicode_literals
from datetime import datetime
import mock
import os
import pytest
import tempfile
import sys
from sacred.run import Run
from sacred.config.config_summary import ConfigSummary
from sacred.utils import (ObserverError, SacredInterrupt, TimeoutInterrupt,
... | true | true |
f73269981546a570cb9a309603dd8f27856144f3 | 9,873 | py | Python | benchmarks/distributed/ddp/compare/compare_ddp.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 60,067 | 2017-01-18T17:21:31.000Z | 2022-03-31T21:37:45.000Z | benchmarks/distributed/ddp/compare/compare_ddp.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 66,955 | 2017-01-18T17:21:38.000Z | 2022-03-31T23:56:11.000Z | benchmarks/distributed/ddp/compare/compare_ddp.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 19,210 | 2017-01-18T17:45:04.000Z | 2022-03-31T23:51:56.000Z | """
A simple tool to compare the performance of different impls of
DistributedDataParallel on resnet50, three flavors:
1. DistributedDataParallel, which has a python wrapper and C++ core to do
gradient distribution and reduction. It's current production version.
2. PythonDDP with async gradient reduction.
3. Pyth... | 38.416342 | 118 | 0.637395 |
import numpy as np
import os
import pickle
import glob
import python_ddp
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
import torch.nn as nn
import torch.optim as optim
import torchvision.models as models
from collections import OrderedDict
from enum import Enum
from tabulate import... | true | true |
f7326999dc24482830c16aa9561534ecbfcf6ab2 | 9,195 | py | Python | tests/chainer_tests/functions_tests/connection_tests/test_n_step_lstm.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | 7 | 2017-05-08T07:02:40.000Z | 2018-12-02T18:35:39.000Z | tests/chainer_tests/functions_tests/connection_tests/test_n_step_lstm.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | null | null | null | tests/chainer_tests/functions_tests/connection_tests/test_n_step_lstm.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | null | null | null | import unittest
import mock
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def sigmoid(x):
return numpy.tanh(x * 0.5) * 0.5 + 0.5
def _split(inputs, pos):
return inputs[:pos]... | 36.78 | 79 | 0.531485 | import unittest
import mock
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def sigmoid(x):
return numpy.tanh(x * 0.5) * 0.5 + 0.5
def _split(inputs, pos):
return inputs[:pos]... | true | true |
f7326a11d6895ddea9102d2cf1365d083cdc73a6 | 4,758 | py | Python | main_live.py | WuYff/ggnn.pytorch | 795bc7fb51876231406d71610aa5ec7ed29865c0 | [
"MIT"
] | null | null | null | main_live.py | WuYff/ggnn.pytorch | 795bc7fb51876231406d71610aa5ec7ed29865c0 | [
"MIT"
] | null | null | null | main_live.py | WuYff/ggnn.pytorch | 795bc7fb51876231406d71610aa5ec7ed29865c0 | [
"MIT"
] | null | null | null | import argparse
import random
import torch
import torch.nn as nn
import torch.optim as optim
from model_live import GGNN
from utils.train_live import train
from utils.test_live import test
from utils.validation_live import validation
from utils.data.wy_dataset_live import bAbIDataset
from utils.data.dataloader import... | 39.983193 | 107 | 0.696511 | import argparse
import random
import torch
import torch.nn as nn
import torch.optim as optim
from model_live import GGNN
from utils.train_live import train
from utils.test_live import test
from utils.validation_live import validation
from utils.data.wy_dataset_live import bAbIDataset
from utils.data.dataloader import... | true | true |
f7326a1f506ca5fb7b3e97b0d077dc016e7eb7c7 | 2,147 | py | Python | ppstructure/table/table_metric/parallel.py | nan-wang/PaddleOCR | 31b06a2fd19f877a09acaf658387bd919c289b8e | [
"Apache-2.0"
] | 20,401 | 2020-05-08T10:56:13.000Z | 2022-03-31T23:34:38.000Z | ppstructure/table/table_metric/parallel.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,988 | 2020-05-10T08:19:41.000Z | 2022-03-31T17:57:11.000Z | ppstructure/table/table_metric/parallel.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,479 | 2020-05-08T11:12:13.000Z | 2022-03-31T11:55:28.000Z | from tqdm import tqdm
from concurrent.futures import ProcessPoolExecutor, as_completed
def parallel_process(array, function, n_jobs=16, use_kwargs=False, front_num=0):
"""
A parallel version of the map function with a progress bar.
Args:
array (array-like): An array to iterate over.
... | 41.288462 | 117 | 0.610154 | from tqdm import tqdm
from concurrent.futures import ProcessPoolExecutor, as_completed
def parallel_process(array, function, n_jobs=16, use_kwargs=False, front_num=0):
if front_num > 0:
front = [function(**a) if use_kwargs else function(a)
for a in array[:front_num]]
else:
... | true | true |
f7326b3311cb80454a1fb34edc479c00815ea490 | 6,749 | py | Python | lib/kubernetes/client/models/v1_storage_class_list.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 7 | 2019-12-21T00:14:14.000Z | 2021-03-11T14:51:37.000Z | lib/kubernetes/client/models/v1_storage_class_list.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 29 | 2019-10-09T11:16:21.000Z | 2020-06-23T09:32:09.000Z | lib/kubernetes/client/models/v1_storage_class_list.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 1 | 2021-05-07T10:13:31.000Z | 2021-05-07T10:13:31.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteri... | 31.834906 | 282 | 0.588532 |
from pprint import pformat
from six import iteritems
import re
class V1StorageClassList(object):
swagger_types = {
'api_version': 'str',
'items': 'list[V1StorageClass]',
'kind': 'str',
'metadata': 'V1ListMeta'
}
attribute_map = {
'api_versio... | true | true |
f7326c132616d2be4a3970c75e1ba25cc38dc29b | 980 | py | Python | baselines/ppo1/test_env/__init__.py | ByzanTine/baselines | 69432726b689c555cdf118ad0dcf9665abbc4b9d | [
"MIT"
] | null | null | null | baselines/ppo1/test_env/__init__.py | ByzanTine/baselines | 69432726b689c555cdf118ad0dcf9665abbc4b9d | [
"MIT"
] | null | null | null | baselines/ppo1/test_env/__init__.py | ByzanTine/baselines | 69432726b689c555cdf118ad0dcf9665abbc4b9d | [
"MIT"
] | null | null | null | from gym.envs.registration import register
import gym
from test_env.envs import *
register(
id='Fourrooms-v1',
entry_point='test_env.envs.fourrooms:Fourrooms',
kwargs={
'map_name': '9x9',
})
register(
id='Fourroomssto-v1',
entry_point='test_env.envs.fourroom_sto:Fourroomssto',
)
regi... | 20 | 69 | 0.687755 | from gym.envs.registration import register
import gym
from test_env.envs import *
register(
id='Fourrooms-v1',
entry_point='test_env.envs.fourrooms:Fourrooms',
kwargs={
'map_name': '9x9',
})
register(
id='Fourroomssto-v1',
entry_point='test_env.envs.fourroom_sto:Fourroomssto',
)
regi... | true | true |
f7326c428c5b6a9d336ebdb571cfc85e2104fd66 | 14,664 | py | Python | horch/legacy/models/detection/enhance.py | sbl1996/pytorch-hrvvi-ext | f19abcbedd844a700b2e2596dd817ea80cbb6287 | [
"MIT"
] | 17 | 2019-05-14T10:47:25.000Z | 2021-06-09T05:39:47.000Z | horch/legacy/models/detection/enhance.py | sbl1996/pytorch-hrvvi-ext | f19abcbedd844a700b2e2596dd817ea80cbb6287 | [
"MIT"
] | null | null | null | horch/legacy/models/detection/enhance.py | sbl1996/pytorch-hrvvi-ext | f19abcbedd844a700b2e2596dd817ea80cbb6287 | [
"MIT"
] | 5 | 2019-08-08T07:04:38.000Z | 2020-07-04T08:58:32.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from horch.common import tuplify
from horch.models.block import mb_conv_block, MBConv
from horch.models.detection.nasfpn import ReLUConvBN
from horch.models.modules import upsample_add, Conv2d, Sequential, Pool2d, upsample_concat
from horch.models.dete... | 36.477612 | 136 | 0.598472 | import torch
import torch.nn as nn
import torch.nn.functional as F
from horch.common import tuplify
from horch.models.block import mb_conv_block, MBConv
from horch.models.detection.nasfpn import ReLUConvBN
from horch.models.modules import upsample_add, Conv2d, Sequential, Pool2d, upsample_concat
from horch.models.dete... | true | true |
f7326c61039f4f44e5db64824c415f984f9b2d6c | 8,034 | py | Python | nnef_tools/io/tf/graphdef/reader.py | dvorotnev/NNEF-Tools | 0219a509c34bb5b291bee497cbd658d6a5922171 | [
"Apache-2.0"
] | null | null | null | nnef_tools/io/tf/graphdef/reader.py | dvorotnev/NNEF-Tools | 0219a509c34bb5b291bee497cbd658d6a5922171 | [
"Apache-2.0"
] | null | null | null | nnef_tools/io/tf/graphdef/reader.py | dvorotnev/NNEF-Tools | 0219a509c34bb5b291bee497cbd658d6a5922171 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 32.136 | 128 | 0.647747 |
from __future__ import division, print_function, absolute_import
from collections import namedtuple
from ....model import *
from ....utils.types import as_str
from .protobuf import *
import numpy as np
import six
Function = namedtuple('Function', ['name', 'attrs'])
_DtypeToNumpy = {
'DT_INVALID': None,
'D... | true | true |
f7326cbc92b19dd088c0d4b5e17acb19500de1d9 | 4,740 | py | Python | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 43 | 2015-09-25T19:46:04.000Z | 2022-01-25T22:38:39.000Z | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 21 | 2015-09-10T15:40:26.000Z | 2021-08-31T15:17:25.000Z | pinax/invitations/views.py | passiv/pinax-invitations | c3194cd1b3cc92a1d706b1f3b018d58948ed5cb2 | [
"MIT"
] | 16 | 2015-09-09T02:32:35.000Z | 2022-03-17T02:51:26.000Z | from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import permission_required
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.decorators im... | 31.184211 | 100 | 0.665401 | from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import permission_required
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.decorators im... | true | true |
f7326d7f452791ff8fb5bc06a352c3c3fbb10c38 | 23,224 | py | Python | test/functional/test_framework/mininode.py | minblock/lockely | 6bc00e80efdf563b52555bc2f547f271f399b03a | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | minblock/lockely | 6bc00e80efdf563b52555bc2f547f271f399b03a | [
"MIT"
] | null | null | null | test/functional/test_framework/mininode.py | minblock/lockely | 6bc00e80efdf563b52555bc2f547f271f399b03a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Lockelycoin ... | 39.362712 | 182 | 0.645065 | import asyncio
from collections import defaultdict
from io import BytesIO
import logging
import struct
import sys
import threading
from test_framework.messages import (
CBlockHeader,
MIN_VERSION_SUPPORTED,
msg_addr,
msg_block,
MSG_BLOCK,
msg_blocktxn,
msg_cmpctblock,
msg_feefilter,
... | true | true |
f7326e08422672f437abdf740d0fd756aaca9b7e | 2,935 | py | Python | two_factor/views/mixins.py | Bassel2387/django-two-factor-auth | e69d9a7fa289a0289e6fc42f4f9cea632e01132d | [
"MIT"
] | 65 | 2021-12-30T16:58:11.000Z | 2022-03-28T21:36:51.000Z | two_factor/views/mixins.py | Bassel2387/django-two-factor-auth | e69d9a7fa289a0289e6fc42f4f9cea632e01132d | [
"MIT"
] | 68 | 2021-12-29T19:48:40.000Z | 2022-03-31T10:51:12.000Z | two_factor/views/mixins.py | Bassel2387/django-two-factor-auth | e69d9a7fa289a0289e6fc42f4f9cea632e01132d | [
"MIT"
] | 21 | 2021-12-30T16:58:14.000Z | 2022-03-30T07:10:23.000Z | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import PermissionDenied
from django.template.response import TemplateResponse
from django.urls import reverse
from ..utils import default_device
class OTPRequiredMixin:
"""
... | 35.361446 | 94 | 0.639864 | from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import PermissionDenied
from django.template.response import TemplateResponse
from django.urls import reverse
from ..utils import default_device
class OTPRequiredMixin:
raise_an... | true | true |
f7326f3839bbb8c4d87f6e6f1636403646f0f7c4 | 6,253 | py | Python | integration-test/992-boundaries-min_zoom-and-name.py | nzjony/vector-datasource | 926555904cf44da06380d808fdc16f4b992bde1f | [
"MIT"
] | null | null | null | integration-test/992-boundaries-min_zoom-and-name.py | nzjony/vector-datasource | 926555904cf44da06380d808fdc16f4b992bde1f | [
"MIT"
] | null | null | null | integration-test/992-boundaries-min_zoom-and-name.py | nzjony/vector-datasource | 926555904cf44da06380d808fdc16f4b992bde1f | [
"MIT"
] | null | null | null | from . import FixtureTest
class BoundariesMinZoomAndNameNe(FixtureTest):
# global:
# # NOTE: Natural Earth 1:50 million used zooms 0,1,2,3,4
# # and only has USA, Canada, Brazil, and Australia
# # all with scalerank of 2 (a documented NE omission).
# # Then 1:10 million N... | 37.89697 | 75 | 0.565009 | from . import FixtureTest
class BoundariesMinZoomAndNameNe(FixtureTest):
def test_england_wales_boundary(self):
self.load_fixtures([
'file://integration-test/fixtures/'
'ne_10m_admin_0_... | true | true |
f7326f9a88e0ca06be5f06f02185b9b5198aa58c | 1,631 | py | Python | aiida_abinit/cli.py | gpetretto/aiida-abinit | bdbfd770eecb44a0b864bdee1d282eab92f7913d | [
"MIT"
] | null | null | null | aiida_abinit/cli.py | gpetretto/aiida-abinit | bdbfd770eecb44a0b864bdee1d282eab92f7913d | [
"MIT"
] | null | null | null | aiida_abinit/cli.py | gpetretto/aiida-abinit | bdbfd770eecb44a0b864bdee1d282eab92f7913d | [
"MIT"
] | null | null | null | """
Command line interface (cli) for aiida_abinit.
Register new commands either via the "console_scripts" entry point or plug them
directly into the 'verdi' command by using AiiDA-specific entry points like
"aiida.cmdline.data" (both in the setup.json file).
"""
import sys
import click
from aiida.cmdline.utils import... | 27.644068 | 87 | 0.676885 |
import sys
import click
from aiida.cmdline.utils import decorators
from aiida.cmdline.commands.cmd_data import verdi_data
from aiida.cmdline.params.types import DataParamType
@verdi_data.group('abinit')
def data_cli():
@data_cli.command('list')
@decorators.with_dbenv()
def list_(): from aiida.orm import Query... | true | true |
f73270246396d797d875be406506d2f9147d1917 | 390 | py | Python | src/CursoEmvideo/ex052.py | kessiarodrigues/Python-Course | 2e6097af4475d826c2b242d4699aec72301060f7 | [
"MIT"
] | null | null | null | src/CursoEmvideo/ex052.py | kessiarodrigues/Python-Course | 2e6097af4475d826c2b242d4699aec72301060f7 | [
"MIT"
] | null | null | null | src/CursoEmvideo/ex052.py | kessiarodrigues/Python-Course | 2e6097af4475d826c2b242d4699aec72301060f7 | [
"MIT"
] | null | null | null | num = int(input('Digite um número: '))
tot = 0
for c in range(1, num + 1):
if num % c == 0:
print('\33[33m', end='')
tot += 1
else:
print('\33[31m', end='')
print('{} '.format(c), end='')
print('\n\033[mO número {} foi divisível {} vezes'.format(num, tot))
if tot == 2:
print('E p... | 26 | 68 | 0.523077 | num = int(input('Digite um número: '))
tot = 0
for c in range(1, num + 1):
if num % c == 0:
print('\33[33m', end='')
tot += 1
else:
print('\33[31m', end='')
print('{} '.format(c), end='')
print('\n\033[mO número {} foi divisível {} vezes'.format(num, tot))
if tot == 2:
print('E p... | true | true |
f732708b48f8553877cd926c4f63a2d192d32cb7 | 5,209 | py | Python | groceries.py | ktg269/groceries-home | 338c40c6b7ad513bb8dd2a07d14133e7bac3427d | [
"MIT"
] | 1 | 2019-06-11T03:06:38.000Z | 2019-06-11T03:06:38.000Z | groceries.py | ktg269/groceries-home | 338c40c6b7ad513bb8dd2a07d14133e7bac3427d | [
"MIT"
] | null | null | null | groceries.py | ktg269/groceries-home | 338c40c6b7ad513bb8dd2a07d14133e7bac3427d | [
"MIT"
] | null | null | null | # groceries.py
products = [
{"id":1, "name": "Chocolate Sandwich Cookies", "department": "snacks", "aisle": "cookies cakes", "price": 3.50},
{"id":2, "name": "All-Seasons Salt", "department": "pantry", "aisle": "spices seasonings", "price": 4.99},
{"id":3, "name": "Robust Golden Unsweetened Oolong Tea", "d... | 41.672 | 158 | 0.623344 |
products = [
{"id":1, "name": "Chocolate Sandwich Cookies", "department": "snacks", "aisle": "cookies cakes", "price": 3.50},
{"id":2, "name": "All-Seasons Salt", "department": "pantry", "aisle": "spices seasonings", "price": 4.99},
{"id":3, "name": "Robust Golden Unsweetened Oolong Tea", "department": "be... | true | true |
f73270dce64166830a82286e79f9f4a512fe8e73 | 889 | py | Python | gamelib/main.py | trascen/u2665 | 95eef1e225a8618eab7c1c5d839329b9df31dc9e | [
"Unlicense"
] | 2 | 2017-10-16T15:27:42.000Z | 2017-10-17T17:13:29.000Z | gamelib/main.py | trascen/u2665 | 95eef1e225a8618eab7c1c5d839329b9df31dc9e | [
"Unlicense"
] | null | null | null | gamelib/main.py | trascen/u2665 | 95eef1e225a8618eab7c1c5d839329b9df31dc9e | [
"Unlicense"
] | null | null | null | '''Game main module.
Contains the entry point used by the run_game.py script.
Feel free to put all your game code here, or in other modules in this "gamelib"
package.
'''
import pygame
import pygame.display
import pygame.surface
import pygame.event
import pygame.image
import pygame.transform
from gamelib.scene impor... | 22.794872 | 101 | 0.655793 |
import pygame
import pygame.display
import pygame.surface
import pygame.event
import pygame.image
import pygame.transform
from gamelib.scene import MainScene
from gamelib.sprite import Spritey
def main():
pygame.init()
real_screen = pygame.display.set_mode([640*2, 480*2])
clock = pygame.time.Clock()
... | true | true |
f7327108494348874c7a463c5e8d80166a93299e | 1,203 | py | Python | manager/director/apps/users/migrations/0004_massemail.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 7 | 2020-08-23T23:08:34.000Z | 2021-12-02T04:17:37.000Z | manager/director/apps/users/migrations/0004_massemail.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 43 | 2020-08-24T16:48:29.000Z | 2022-03-02T19:45:54.000Z | manager/director/apps/users/migrations/0004_massemail.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 10 | 2020-08-17T20:42:52.000Z | 2021-07-16T03:46:51.000Z | # Generated by Django 2.2.12 on 2020-04-07 14:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0003_user_accepted_guidelines'),
]
operations = [
migrations.Cre... | 41.482759 | 194 | 0.637573 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0003_user_accepted_guidelines'),
]
operations = [
migrations.CreateModel(
name='MassEmail',
... | true | true |
f732712de1cc15b3e1d91ae8e6631e12c2ea6874 | 6,412 | py | Python | src/signal_processing_algorithms/gesd.py | dbradf/signal-processing-algorithms | 75312e873543f0f89aace75f43ded783395425c5 | [
"Apache-2.0"
] | 19 | 2020-04-13T11:26:50.000Z | 2022-03-28T12:43:04.000Z | src/signal_processing_algorithms/gesd.py | dbradf/signal-processing-algorithms | 75312e873543f0f89aace75f43ded783395425c5 | [
"Apache-2.0"
] | 11 | 2020-03-17T19:20:21.000Z | 2022-01-27T22:27:25.000Z | src/signal_processing_algorithms/gesd.py | dbradf/signal-processing-algorithms | 75312e873543f0f89aace75f43ded783395425c5 | [
"Apache-2.0"
] | 5 | 2020-05-13T16:53:40.000Z | 2022-01-26T23:11:45.000Z | # -*- coding: utf-8 -*-
"""
GESD based Detect outliers.
Generalized ESD Test for Outliers
see 'GESD<https://www.itl.nist.gov/div898/handbook/eda/section3/eda35h3.htm>'
"""
import collections
from typing import List
import numpy as np
import numpy.ma as ma
import structlog
from scipy.stats import t
LOG = structlog.... | 34.473118 | 100 | 0.629757 | import collections
from typing import List
import numpy as np
import numpy.ma as ma
import structlog
from scipy.stats import t
LOG = structlog.get_logger()
GesdResult = collections.namedtuple(
"GesdResult",
["count", "suspicious_indexes", "test_statistics", "critical_values", "all_z_scores"],
)
def gesd(... | true | true |
f7327283137a8089ad6e5e8c1b25b9b0b020b6c1 | 3,502 | py | Python | salt/states/mdadm.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | 1 | 2018-02-03T17:30:56.000Z | 2018-02-03T17:30:56.000Z | salt/states/mdadm.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/states/mdadm.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Managing software RAID with mdadm
==================================
A state module for creating or destroying software RAID devices.
.. code-block:: yaml
/dev/md0:
raid.present:
- opts: level=1 chunk=256 raid-devices=2 /dev/xvdd /dev/xvde
'''
# Import python libs
impor... | 23.823129 | 76 | 0.540548 |
import logging
import salt.utils
log = logging.getLogger(__name__)
__virtualname__ = 'raid'
def __virtual__():
if __grains__['kernel'] != 'Linux':
return False
if not salt.utils.which('mdadm'):
return False
return __virtualname__
def present(name, opts=None):
ret = {'changes': {}... | true | true |
f73274ca464f6c55696bccac5f5bb1b094e363e5 | 2,916 | py | Python | var/spack/repos/builtin/packages/eospac/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2021-02-22T18:04:31.000Z | 2021-02-22T18:04:31.000Z | var/spack/repos/builtin/packages/eospac/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-04-24T13:30:08.000Z | 2020-04-24T13:40:08.000Z | var/spack/repos/builtin/packages/eospac/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-03-06T11:04:37.000Z | 2020-03-06T11:04:37.000Z | # Copyright 2013-2020 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)
from spack import *
class Eospac(Package):
"""A collection of C routines that can be used to access the Sesame data... | 57.176471 | 159 | 0.698903 |
from spack import *
class Eospac(Package):
homepage = "http://laws.lanl.gov/projects/data/eos.html"
list_url = "http://laws.lanl.gov/projects/data/eos/eospacReleases.php"
version('6.4.0', sha256='15a953beac735c68431afe86ffe33323d540d0fbbbec03ba79438dd29736051d',
url="http://laws.lanl... | true | true |
f73274e98631a7c59fbcf53f1b533864bc4b4c67 | 6,295 | py | Python | Functions/FormFactors/SphericalShell_expDecay.py | prjemian/XAnoS | 8a70380a88421042feff6f4aa9f5cf1f79ab4efc | [
"MIT"
] | null | null | null | Functions/FormFactors/SphericalShell_expDecay.py | prjemian/XAnoS | 8a70380a88421042feff6f4aa9f5cf1f79ab4efc | [
"MIT"
] | null | null | null | Functions/FormFactors/SphericalShell_expDecay.py | prjemian/XAnoS | 8a70380a88421042feff6f4aa9f5cf1f79ab4efc | [
"MIT"
] | null | null | null | ####Please do not remove lines below####
from lmfit import Parameters
import numpy as np
import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('./Functions'))
sys.path.append(os.path.abspath('./Fortran_rountines'))
####Please do not remove lines above####
####Import your modules b... | 46.62963 | 177 | 0.624305 | from lmfit import Parameters
import numpy as np
import sys
import os
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('./Functions'))
sys.path.append(os.path.abspath('./Fortran_rountines'))
from xraydb import XrayDB
class SphericalShell_expDecay: No = 6.023e23 re2= (2.817e-5)**2 de... | true | true |
f7327574c3e9432aac029aee865c8a55bab5ede4 | 282 | py | Python | hexa/core/migrations/0008_ci_text.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 4 | 2021-07-19T12:53:21.000Z | 2022-01-26T17:45:02.000Z | hexa/core/migrations/0008_ci_text.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 20 | 2021-05-17T12:27:06.000Z | 2022-03-30T11:35:26.000Z | hexa/core/migrations/0008_ci_text.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 2 | 2021-09-07T04:19:59.000Z | 2022-02-08T15:33:29.000Z | # Generated by Django 4.0 on 2022-01-10 15:42
from django.contrib.postgres.operations import CITextExtension
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("core", "0007_ltree"),
]
operations = [CITextExtension()]
| 20.142857 | 62 | 0.712766 |
from django.contrib.postgres.operations import CITextExtension
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("core", "0007_ltree"),
]
operations = [CITextExtension()]
| true | true |
f7327641ba028e0a7583ec0d94fadffc14edd2ba | 3,143 | py | Python | prml/linear/_bayesian_regression.py | alexandru-dinu/PRML | acd823e098df67abe0306a70225e7539f8edda40 | [
"MIT"
] | null | null | null | prml/linear/_bayesian_regression.py | alexandru-dinu/PRML | acd823e098df67abe0306a70225e7539f8edda40 | [
"MIT"
] | null | null | null | prml/linear/_bayesian_regression.py | alexandru-dinu/PRML | acd823e098df67abe0306a70225e7539f8edda40 | [
"MIT"
] | 1 | 2019-06-22T20:56:02.000Z | 2019-06-22T20:56:02.000Z | import numpy as np
from prml.linear._regression import Regression
class BayesianRegression(Regression):
"""Bayesian regression model.
w ~ N(w|0, alpha^(-1)I)
y = X @ w
t ~ N(t|X @ w, beta^(-1))
"""
def __init__(self, alpha: float = 1.0, beta: float = 1.0):
"""Initialize bayesian lin... | 31.43 | 75 | 0.570474 | import numpy as np
from prml.linear._regression import Regression
class BayesianRegression(Regression):
def __init__(self, alpha: float = 1.0, beta: float = 1.0):
self.alpha = alpha
self.beta = beta
self.w_mean = None
self.w_precision = None
def _is_prior_defined(self) -> bo... | true | true |
f73276b8fb36b5de1ebbd4da742bc1622708cb89 | 3,072 | py | Python | py/kubeflow/testing/py_lint_test.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | null | null | null | py/kubeflow/testing/py_lint_test.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | 451 | 2021-01-22T12:27:17.000Z | 2022-03-30T02:08:22.000Z | py/kubeflow/testing/py_lint_test.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | null | null | null | import fnmatch
import logging
import os
import subprocess
from kubeflow.testing import util
import pytest
logging.basicConfig(
level=logging.INFO,
format=('%(levelname)s|%(asctime)s'
'|%(pathname)s|%(lineno)d| %(message)s'),
datefmt='%Y-%m-%dT%H:%M:%S',
)
logging.getLogger().setLevel(logging.... | 30.72 | 92 | 0.675456 | import fnmatch
import logging
import os
import subprocess
from kubeflow.testing import util
import pytest
logging.basicConfig(
level=logging.INFO,
format=('%(levelname)s|%(asctime)s'
'|%(pathname)s|%(lineno)d| %(message)s'),
datefmt='%Y-%m-%dT%H:%M:%S',
)
logging.getLogger().setLevel(logging.... | true | true |
f73276ff40784e608204573966e21fed99f4909c | 38,349 | py | Python | tensorflow/python/saved_model/save.py | jnorwood/tensorflow | 67ab6c9cebc4cbb2103246a1523d04261bef22d2 | [
"Apache-2.0"
] | 2 | 2019-06-01T08:12:42.000Z | 2019-06-01T08:13:22.000Z | tensorflow/python/saved_model/save.py | jnorwood/tensorflow | 67ab6c9cebc4cbb2103246a1523d04261bef22d2 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/saved_model/save.py | jnorwood/tensorflow | 67ab6c9cebc4cbb2103246a1523d04261bef22d2 | [
"Apache-2.0"
] | 1 | 2019-05-25T17:45:38.000Z | 2019-05-25T17:45:38.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 46.092548 | 157 | 0.755535 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
from tensorflow.core.framework import versions_pb2
from tensorflow.core.protobuf import meta_graph_pb2
from tensorflow.core.protobuf import saved_model_pb2
from tensorflow.core.pr... | true | true |
f73278f35cc7eb414b5cff724f44716c77daceda | 74,836 | py | Python | samples/openapi3/client/petstore/python/petstore_api/model_utils.py | mabhijith95a10/openapi-generator | 0f5e7d1e3cb9642bd46ec89ffe0bf66a922029f2 | [
"Apache-2.0"
] | 1 | 2021-04-16T03:59:56.000Z | 2021-04-16T03:59:56.000Z | samples/openapi3/client/petstore/python/petstore_api/model_utils.py | mabhijith95a10/openapi-generator | 0f5e7d1e3cb9642bd46ec89ffe0bf66a922029f2 | [
"Apache-2.0"
] | 26 | 2021-03-19T20:50:29.000Z | 2022-03-21T11:32:33.000Z | samples/openapi3/client/petstore/python/petstore_api/model_utils.py | mabhijith95a10/openapi-generator | 0f5e7d1e3cb9642bd46ec89ffe0bf66a922029f2 | [
"Apache-2.0"
] | 2 | 2021-06-11T15:24:43.000Z | 2021-06-13T12:20:31.000Z | """
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from datetime im... | 39.449657 | 174 | 0.628721 |
from datetime import date, datetime import inspect
import io
import os
import pprint
import re
import tempfile
from dateutil.parser import parse
from petstore_api.exceptions import (
ApiKeyError,
ApiAttributeError,
ApiTypeError,
ApiValueError,
)
none_type = type(None)
file_type = io.IOBase
class... | true | true |
f73279dc5fe54fd731c68c1129c641f01a89beae | 596 | py | Python | Exercises/Exercises Chapter 08/8.1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 2 | 2021-09-23T19:17:24.000Z | 2021-11-29T09:03:56.000Z | Exercises/Exercises Chapter 08/8.1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | null | null | null | Exercises/Exercises Chapter 08/8.1.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 1 | 2020-10-25T13:03:18.000Z | 2020-10-25T13:03:18.000Z | #definition for music_func goes here
def music_func(music, group, singer):
print("The best kind of music is", music)
print("The best music group is", group)
print("The best lead vocalist is", singer)
def main():
music, group, singer = '', '', ''
while music != 'quit':
try:
music... | 33.111111 | 83 | 0.590604 | def music_func(music, group, singer):
print("The best kind of music is", music)
print("The best music group is", group)
print("The best lead vocalist is", singer)
def main():
music, group, singer = '', '', ''
while music != 'quit':
try:
music, group, singer = input().split(',')
... | true | true |
f7327a79deea631d212afcb19ff20ebec7be7258 | 7,139 | py | Python | pybind/slxos/v16r_1_00b/vrf/address_family/ip/unicast/ip/import_/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/vrf/address_family/ip/unicast/ip/import_/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/vrf/address_family/ip/unicast/ip/import_/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 55.773438 | 779 | 0.713966 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f7327aa07b2ff6ab2654821bbe8ee0851143350f | 121,870 | py | Python | monai/transforms/spatial/array.py | Jianrong-Lu/MONAI | c319ca8ff31aa980a045f1b913fb2eb22aadb080 | [
"Apache-2.0"
] | 1 | 2022-03-16T01:18:43.000Z | 2022-03-16T01:18:43.000Z | monai/transforms/spatial/array.py | Jianrong-Lu/MONAI | c319ca8ff31aa980a045f1b913fb2eb22aadb080 | [
"Apache-2.0"
] | null | null | null | monai/transforms/spatial/array.py | Jianrong-Lu/MONAI | c319ca8ff31aa980a045f1b913fb2eb22aadb080 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 49.480309 | 129 | 0.622951 | import warnings
from copy import deepcopy
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
import numpy as np
import torch
from monai.config import USE_COMPILED, DtypeLike
from monai.config.type_definitions import NdarrayOrTensor
from monai.data.utils import AFFINE_TOL, compute_shape_off... | true | true |
f7327b0acca1ec68ef13a676068181bf6461221b | 43 | py | Python | passbook/audit/urls.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | passbook/audit/urls.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | passbook/audit/urls.py | fossabot/passbook | cba17f6659404445ac3025f11657d89368cc8b4f | [
"MIT"
] | null | null | null | """passbook audit urls"""
urlpatterns = []
| 14.333333 | 25 | 0.651163 | urlpatterns = []
| true | true |
f7327ef8305d5caec9af3eb2d964b224057a2427 | 1,539 | py | Python | AI/others/aws_rekognition/test_compare_faces/main.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | null | null | null | AI/others/aws_rekognition/test_compare_faces/main.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | 3 | 2020-03-24T16:26:35.000Z | 2020-04-15T19:40:41.000Z | AI/others/aws_rekognition/test_compare_faces/main.py | honchardev/Fun | ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc | [
"MIT"
] | null | null | null | from dotenv import load_dotenv
import os
import boto3
# Define constants
load_dotenv()
AWS_USERNAME = os.environ['aws_username']
AWS_BUCKET = os.environ['aws_bucket']
AWS_REGION = os.environ['aws_region']
AWS_ACCESS_KEY_ID = os.environ['aws_access_key_id']
AWS_SECRET_ACCESS_KEY = os.environ['aws_secret_access_key']
... | 27.482143 | 110 | 0.747238 | from dotenv import load_dotenv
import os
import boto3
load_dotenv()
AWS_USERNAME = os.environ['aws_username']
AWS_BUCKET = os.environ['aws_bucket']
AWS_REGION = os.environ['aws_region']
AWS_ACCESS_KEY_ID = os.environ['aws_access_key_id']
AWS_SECRET_ACCESS_KEY = os.environ['aws_secret_access_key']
aws_rekognition_cl... | true | true |
f7327eff75f87ec7bbe56c0c96e4299744d97d89 | 22,181 | py | Python | compass/embedding.py | seitalab/compass | b08b0b711875e8e049ff07793ffe1446a6c3f144 | [
"MIT"
] | null | null | null | compass/embedding.py | seitalab/compass | b08b0b711875e8e049ff07793ffe1446a6c3f144 | [
"MIT"
] | null | null | null | compass/embedding.py | seitalab/compass | b08b0b711875e8e049ff07793ffe1446a6c3f144 | [
"MIT"
] | null | null | null | from sklearn.metrics.pairwise import cosine_similarity
from sklearn.manifold import TSNE
from sklearn.cluster import AgglomerativeClustering, KMeans
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import pandas
import matplotlib.cm as cm
import umap... | 41.693609 | 237 | 0.581939 | from sklearn.metrics.pairwise import cosine_similarity
from sklearn.manifold import TSNE
from sklearn.cluster import AgglomerativeClustering, KMeans
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
import pandas
import matplotlib.cm as cm
import umap... | true | true |
f7327fac62add1269af1efbeb3c9b14e1e8be449 | 92 | py | Python | scraper/__main__.py | isareds/Ateco-Codes-Scraper | 9b1e714c2e0ebaa9f2a3ca563099bc739c9d7ac5 | [
"BSD-2-Clause"
] | null | null | null | scraper/__main__.py | isareds/Ateco-Codes-Scraper | 9b1e714c2e0ebaa9f2a3ca563099bc739c9d7ac5 | [
"BSD-2-Clause"
] | null | null | null | scraper/__main__.py | isareds/Ateco-Codes-Scraper | 9b1e714c2e0ebaa9f2a3ca563099bc739c9d7ac5 | [
"BSD-2-Clause"
] | null | null | null | from scraper import scrape
def main():
scrape()
if __name__ == '__main__':
main()
| 11.5 | 26 | 0.630435 | from scraper import scrape
def main():
scrape()
if __name__ == '__main__':
main()
| true | true |
f7328057087962ad9e6c08863139837e1f659948 | 5,366 | py | Python | docker/files/j2-filters.py | bihealth/irods-docker | 7f02be3f027e4606de56a85bc27d05b11bac736c | [
"MIT"
] | null | null | null | docker/files/j2-filters.py | bihealth/irods-docker | 7f02be3f027e4606de56a85bc27d05b11bac736c | [
"MIT"
] | 7 | 2021-10-08T09:19:12.000Z | 2022-03-29T15:22:06.000Z | docker/files/j2-filters.py | bihealth/irods-docker | 7f02be3f027e4606de56a85bc27d05b11bac736c | [
"MIT"
] | null | null | null | # NOTE: These are taken from the jinja2-ansible-filters package:
# NOTE: https://pypi.org/project/jinja2-ansible-filters
# NOTE: The installer has a problem in its egg-info preventing a regular pip install.
# NOTE: If we do not need the b64encode filter, we can omit this file and the filter setup.
# (c) 2012, Jeroen H... | 32.521212 | 91 | 0.62691 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import base64
import codecs
try:
string_types = basestring,
integer_types = (int, long)
class_types = (type, types.ClassType)
text_type = unicode
binary_type = str
from collections import Sequence
except ... | true | true |
f7328081f748a48e3cf5d90ec0297525e64a80a6 | 15,124 | py | Python | flair/trainers/language_model_trainer.py | azawalich/flair | f0101ab25381aefa586ecb688d4f412d5fab5de3 | [
"MIT"
] | null | null | null | flair/trainers/language_model_trainer.py | azawalich/flair | f0101ab25381aefa586ecb688d4f412d5fab5de3 | [
"MIT"
] | null | null | null | flair/trainers/language_model_trainer.py | azawalich/flair | f0101ab25381aefa586ecb688d4f412d5fab5de3 | [
"MIT"
] | null | null | null |
import time
import datetime
import random
import sys
import logging
from pathlib import Path
from typing import Union
from torch import cuda
from torch.utils.data import Dataset, DataLoader
from torch.optim.sgd import SGD
try:
from apex import amp
except ImportError:
amp = None
import flair
from flair.data imp... | 46.250765 | 253 | 0.540796 |
import time
import datetime
import random
import sys
import logging
from pathlib import Path
from typing import Union
from torch import cuda
from torch.utils.data import Dataset, DataLoader
from torch.optim.sgd import SGD
try:
from apex import amp
except ImportError:
amp = None
import flair
from flair.data imp... | true | true |
f732816fcf0c052b8864c70a21b2d1c1057d92db | 14,981 | py | Python | airflow/providers/google/suite/hooks/sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 8 | 2017-04-20T16:15:44.000Z | 2020-10-11T13:44:10.000Z | airflow/providers/google/suite/hooks/sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 219 | 2017-03-15T18:40:16.000Z | 2022-02-28T22:52:43.000Z | airflow/providers/google/suite/hooks/sheets.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 3 | 2016-07-14T21:51:10.000Z | 2020-10-12T13:26:36.000Z | #
# 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... | 40.489189 | 103 | 0.660437 |
from typing import Any, Dict, List, Optional
from googleapiclient.discovery import build
from airflow.exceptions import AirflowException
from airflow.providers.google.cloud.hooks.base import CloudBaseHook
class GSheetsHook(CloudBaseHook):
def __init__(
self,
spreadsheet_id: str,
gcp_co... | true | true |
f73281be9ced4bbfcc2aa580105b37462d473a71 | 5,152 | py | Python | vespa/pulse/auto_gui/manage_pulse_designs.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | null | null | null | vespa/pulse/auto_gui/manage_pulse_designs.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | 4 | 2021-04-17T13:58:31.000Z | 2022-01-20T14:19:57.000Z | vespa/pulse/auto_gui/manage_pulse_designs.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | 3 | 2021-06-05T16:34:57.000Z | 2022-01-19T16:13:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.5 on Mon Jul 27 15:21:25 2015
import wx
# begin wxGlade: extracode
# end wxGlade
class MyDialog(wx.Dialog):
def __init__(self, *args, **kwds):
# begin wxGlade: MyDialog.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEF... | 42.578512 | 100 | 0.65528 |
import wx
class MyDialog(wx.Dialog):
def __init__(self, *args, **kwds):
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
wx.Dialog.__init__(self, *args, **kwds)
self.label_2 = wx.StaticText(self, wx.ID_ANY, "")
self.label_1 = wx.StaticText... | true | true |
f73281d82427249aef51b7db781136ffb89a9860 | 1,042 | py | Python | isi_sdk_8_1_1/test/test_providers_summary_provider_instance.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/test/test_providers_summary_provider_instance.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/test/test_providers_summary_provider_instance.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: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... | 25.414634 | 123 | 0.744722 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from isi_sdk_8_1_1.models.providers_summary_provider_instance import ProvidersSummaryProviderInstance from isi_sdk_8_1_1.rest import ApiException
class TestProvidersSummaryProviderInstance(unittest.TestCase):
def setUp(self):
... | true | true |
f732826458cc6b350d8bd7d018b41884c4e3e17e | 50 | py | Python | ineuron/Python_Assignment_2/reverse.py | niraj-kale/ineuron | f1ee3df4e666b0579a6aaec409c0557650c338da | [
"MIT"
] | null | null | null | ineuron/Python_Assignment_2/reverse.py | niraj-kale/ineuron | f1ee3df4e666b0579a6aaec409c0557650c338da | [
"MIT"
] | null | null | null | ineuron/Python_Assignment_2/reverse.py | niraj-kale/ineuron | f1ee3df4e666b0579a6aaec409c0557650c338da | [
"MIT"
] | null | null | null | word = input("Input a word : ")
print(word[::-1]) | 16.666667 | 31 | 0.58 | word = input("Input a word : ")
print(word[::-1]) | true | true |
f73283321fed4349be2b954e61d0cbe802264e78 | 3,075 | py | Python | cellpack/mgl_tools/mglutil/web/Tests/test_htmlparser.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | cellpack/mgl_tools/mglutil/web/Tests/test_htmlparser.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | 21 | 2021-10-02T00:07:05.000Z | 2022-03-30T00:02:10.000Z | cellpack/mgl_tools/mglutil/web/Tests/test_htmlparser.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | #########################################################################
#
# Date: Nov. 2002 Author: Daniel Stoffler
#
# Copyright: Daniel Stoffler and TSRI
#
#########################################################################
import sys
from mglutil.regression import testplus
from mglutil.web import HTMLParse... | 34.550562 | 83 | 0.556748 |
import sys
from mglutil.regression import testplus
from mglutil.web import HTMLParser
from time import sleep
def pause(sleepTime=0.4):
ed.master.update()
sleep(sleepTime)
def test_ParseCGIForms():
f = open("Data/testfile.html", "r")
txt = f.readlines()
P = HTMLParser.ParseHTML(mode="forms")
... | true | true |
f73283969bf30cb0fc5192375960b26d761e5a1f | 3,088 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/TableLayoutCellPaintEventHandler.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/TableLayoutCellPaintEventHandler.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/TableLayoutCellPaintEventHandler.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class TableLayoutCellPaintEventHandler(MulticastDelegate, ICloneable, ISerializable):
"""
Represents the method that will handle the System.Windows.Forms.TableLayoutPanel.CellPaint event.
TableLayoutCellPaintEventHandler(object: object,method: IntPtr)
"""
def BeginInvoke(self, sender, e, callba... | 29.409524 | 221 | 0.680376 | class TableLayoutCellPaintEventHandler(MulticastDelegate, ICloneable, ISerializable):
def BeginInvoke(self, sender, e, callback, object):
pass
def CombineImpl(self, *args):
pass
def DynamicInvokeImpl(self, *args):
pass
def EndInvoke(self, result):
pass
... | true | true |
f73283aa4b808065d101ef22fa6cf7432a504266 | 1,531 | py | Python | test/autests/gold_tests/http2/http2.test.py | dragon512/proxy-verifier | d48d680bb5a2540af3c2cdc2968a4c1bef7546e1 | [
"Apache-2.0"
] | null | null | null | test/autests/gold_tests/http2/http2.test.py | dragon512/proxy-verifier | d48d680bb5a2540af3c2cdc2968a4c1bef7546e1 | [
"Apache-2.0"
] | null | null | null | test/autests/gold_tests/http2/http2.test.py | dragon512/proxy-verifier | d48d680bb5a2540af3c2cdc2968a4c1bef7546e1 | [
"Apache-2.0"
] | null | null | null | '''
Verify basic HTTP/2 functionality.
'''
# @file
#
# Copyright 2020, Verizon Media
# SPDX-License-Identifier: Apache-2.0
#
Test.Summary = '''
Verify basic HTTP/2 functionality.
'''
#
# Test 1: Verify correct behavior of a single HTTP/2 transaction.
#
r = Test.AddTestRun("Verify HTTP/2 processing of a single HTTP tr... | 37.341463 | 79 | 0.713912 |
Test.Summary = '''
Verify basic HTTP/2 functionality.
'''
r = Test.AddTestRun("Verify HTTP/2 processing of a single HTTP transaction")
client = r.AddClientProcess("client1", "replay_files/single_transaction",
https_ports=[4443], other_args="--verbose diag")
server = r.AddServerProcess("ser... | true | true |
f73284f572868ccb38a791c5403e5082b6b22e6b | 1,386 | py | Python | 17abriledp.py | mecanimatico/codigo_edp | 42080a4eb0f604873f9743ff0d0b8afde0735181 | [
"MIT"
] | null | null | null | 17abriledp.py | mecanimatico/codigo_edp | 42080a4eb0f604873f9743ff0d0b8afde0735181 | [
"MIT"
] | null | null | null | 17abriledp.py | mecanimatico/codigo_edp | 42080a4eb0f604873f9743ff0d0b8afde0735181 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 17 09:57:12 2020
@author: Heber
"""
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
#%% valor exacto d ela derivada
up = np.cos(1.0)
h = 0.1
up_aprox = (np.sin(1+h)-np.sin(1))/h
error = up - up_aprox
print ("Valor aproximado: ",up_aprox)... | 21.323077 | 66 | 0.626984 | import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
up = np.cos(1.0)
h = 0.1
up_aprox = (np.sin(1+h)-np.sin(1))/h
error = up - up_aprox
print ("Valor aproximado: ",up_aprox)
print ("Valor del error: ",error)
list = [0.1, 0.01, 0.001, 0.0001, 0.00001]
aprox_values = []
errores_values = [... | true | true |
f73287eee23516b86d7a58a9027c13d6bae3f980 | 993 | py | Python | doc/sphinxext/setup.py | celiafish/scikit-xray | 660a37821d58544b6443c5b8cd9c96daef577ed2 | [
"BSD-3-Clause"
] | 71 | 2016-01-04T22:32:27.000Z | 2022-03-25T07:57:54.000Z | doc/sphinxext/setup.py | celiafish/scikit-xray | 660a37821d58544b6443c5b8cd9c96daef577ed2 | [
"BSD-3-Clause"
] | 288 | 2015-12-09T23:40:31.000Z | 2021-02-02T00:32:00.000Z | doc/sphinxext/setup.py | celiafish/scikit-xray | 660a37821d58544b6443c5b8cd9c96daef577ed2 | [
"BSD-3-Clause"
] | 53 | 2015-12-10T14:35:17.000Z | 2021-06-24T13:36:00.000Z | from distutils.core import setup
import setuptools
import sys
import os
version = "0.3.dev"
setup(
name="numpydoc",
packages=["numpydoc"],
package_dir={"numpydoc": ""},
version=version,
description="Sphinx extension to support docstrings in Numpy format",
# classifiers from http://pypi.python.... | 30.090909 | 77 | 0.629406 | from distutils.core import setup
import setuptools
import sys
import os
version = "0.3.dev"
setup(
name="numpydoc",
packages=["numpydoc"],
package_dir={"numpydoc": ""},
version=version,
description="Sphinx extension to support docstrings in Numpy format",
classifiers=["Development Status :... | true | true |
f73289685bd37aa689ba66d97e917694c4fc2fa7 | 1,147 | py | Python | remake/examples/ex8.py | markmuetz/remake | a3c5098be57b60b01ffaa4a7fcb937f9337dcdea | [
"Apache-2.0"
] | null | null | null | remake/examples/ex8.py | markmuetz/remake | a3c5098be57b60b01ffaa4a7fcb937f9337dcdea | [
"Apache-2.0"
] | 35 | 2020-12-22T11:36:46.000Z | 2021-12-03T15:49:41.000Z | remake/examples/ex8.py | markmuetz/remake | a3c5098be57b60b01ffaa4a7fcb937f9337dcdea | [
"Apache-2.0"
] | null | null | null | """Demonstrates partial run when some input data not there.
"""
from remake import Remake, TaskRule
ex8 = Remake()
class CannotRun(TaskRule):
rule_inputs = {'in1': 'data/inputs/input_not_there.txt'}
rule_outputs = {'out': 'data/inputs/ex8_in1.txt'}
def rule_run(self):
input_text = self.inputs['i... | 28.675 | 101 | 0.617262 | from remake import Remake, TaskRule
ex8 = Remake()
class CannotRun(TaskRule):
rule_inputs = {'in1': 'data/inputs/input_not_there.txt'}
rule_outputs = {'out': 'data/inputs/ex8_in1.txt'}
def rule_run(self):
input_text = self.inputs['in1'].read_text()
self.outputs['out'].write_text(input_te... | true | true |
f73289beadbbd779b42062ae2dd20756a3a1975e | 18,377 | py | Python | python_modules/dagster/dagster/core/types/runtime.py | cclauss/dagster | 6494edbfd52526812aadf941bf90edf3ade1d912 | [
"Apache-2.0"
] | 1 | 2019-07-15T17:34:04.000Z | 2019-07-15T17:34:04.000Z | python_modules/dagster/dagster/core/types/runtime.py | stevencasey/dagster | 1881f67f55725c40432dbc1ed99b8cfbd9629600 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/types/runtime.py | stevencasey/dagster | 1881f67f55725c40432dbc1ed99b8cfbd9629600 | [
"Apache-2.0"
] | null | null | null | from functools import partial
import six
from dagster import check
from dagster.core.storage.type_storage import TypeStoragePlugin
from .builtin_enum import BuiltinEnum
from .builtin_config_schemas import BuiltinSchemas
from .config import ConfigType
from .config import List as ConfigList
from .config import Nullab... | 31.467466 | 100 | 0.681885 | from functools import partial
import six
from dagster import check
from dagster.core.storage.type_storage import TypeStoragePlugin
from .builtin_enum import BuiltinEnum
from .builtin_config_schemas import BuiltinSchemas
from .config import ConfigType
from .config import List as ConfigList
from .config import Nullab... | true | true |
f7328a99195b9c2f34557772f93a23c78d7e72a9 | 43,541 | py | Python | pandas/tests/indexes/test_category.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/test_category.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/test_category.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | 1 | 2019-03-31T13:46:57.000Z | 2019-03-31T13:46:57.000Z | # -*- coding: utf-8 -*-
import pytest
import pandas.util.testing as tm
from pandas.core.indexes.api import Index, CategoricalIndex
from pandas.core.dtypes.dtypes import CategoricalDtype
from .common import Base
from pandas.compat import range, PY3
import numpy as np
from pandas import Categorical, IntervalIndex, c... | 40.883568 | 148 | 0.538757 |
import pytest
import pandas.util.testing as tm
from pandas.core.indexes.api import Index, CategoricalIndex
from pandas.core.dtypes.dtypes import CategoricalDtype
from .common import Base
from pandas.compat import range, PY3
import numpy as np
from pandas import Categorical, IntervalIndex, compat
from pandas.util.t... | true | true |
f7328ae4cc169670c4d9df3cd477025254fdd601 | 1,362 | py | Python | python/dazl/prim/map.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/prim/map.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/prim/map.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
__all__ = ["FrozenDict", "to_hashable"]
class FrozenDict(dict):
"""
A special subclass of `dict` that is immutable and hashable. Instances of this "dict" can be
use... | 27.795918 | 102 | 0.666667 |
__all__ = ["FrozenDict", "to_hashable"]
class FrozenDict(dict):
def __hash__(self):
return 0
def __delitem__(self, *args, **kwargs):
raise RuntimeError("frozendicts are immutable")
def __setitem__(self, key, value):
raise RuntimeError("frozendicts are immutable")
def pop(s... | true | true |
f7328b27c5d39fc42635191efb78c9f2abcabf91 | 824 | py | Python | core/queue.py | Kaneki1416/kenKaneki | cdd59c18b74d559d277b736e5e536884ce4e9499 | [
"MIT"
] | 1 | 2022-01-11T21:59:34.000Z | 2022-01-11T21:59:34.000Z | core/queue.py | Kaneki1416/kenKaneki | cdd59c18b74d559d277b736e5e536884ce4e9499 | [
"MIT"
] | 1 | 2022-01-22T14:40:01.000Z | 2022-01-22T14:40:59.000Z | core/queue.py | Kaneki1416/kenKaneki | cdd59c18b74d559d277b736e5e536884ce4e9499 | [
"MIT"
] | 4 | 2021-11-19T12:45:56.000Z | 2022-02-12T03:28:44.000Z | from typing import Dict, List
class Playlist:
def __init__(self):
self.__queue: Dict[int, List[Dict[str, str]]] = {}
def insert_one(self, chat_id: int, data: Dict[str, str]):
if chat_id not in self.__queue:
self.__queue[chat_id] = [data]
else:
queue = self.__qu... | 25.75 | 94 | 0.618932 | from typing import Dict, List
class Playlist:
def __init__(self):
self.__queue: Dict[int, List[Dict[str, str]]] = {}
def insert_one(self, chat_id: int, data: Dict[str, str]):
if chat_id not in self.__queue:
self.__queue[chat_id] = [data]
else:
queue = self.__qu... | true | true |
f7328c285019752a361691904a430d2add9f3a79 | 7,933 | py | Python | smellCatalog/HtmlGenerator.py | neilernst/smells | c093ee72a12f62693d8635359b7ca4958ecba0e0 | [
"MIT"
] | null | null | null | smellCatalog/HtmlGenerator.py | neilernst/smells | c093ee72a12f62693d8635359b7ca4958ecba0e0 | [
"MIT"
] | null | null | null | smellCatalog/HtmlGenerator.py | neilernst/smells | c093ee72a12f62693d8635359b7ca4958ecba0e0 | [
"MIT"
] | 1 | 2019-07-15T14:16:37.000Z | 2019-07-15T14:16:37.000Z | import os
import datetime
import FixedText
class HtmlGenerator(object):
def __init__(self, output_path, smell_list, category_list):
self.smell_list = smell_list
self.out_path = output_path
self.category_list = category_list
def generate(self):
self.generate_index()
self... | 46.122093 | 134 | 0.576201 | import os
import datetime
import FixedText
class HtmlGenerator(object):
def __init__(self, output_path, smell_list, category_list):
self.smell_list = smell_list
self.out_path = output_path
self.category_list = category_list
def generate(self):
self.generate_index()
self... | true | true |
f7328d27708be173337c84cd136370e78d9f3791 | 1,827 | py | Python | controller/test5_hw_test/rotate_axis.py | drummonds/od-robot | a74954aefecb49654686dc0539ea23cb915c6f4d | [
"MIT"
] | null | null | null | controller/test5_hw_test/rotate_axis.py | drummonds/od-robot | a74954aefecb49654686dc0539ea23cb915c6f4d | [
"MIT"
] | null | null | null | controller/test5_hw_test/rotate_axis.py | drummonds/od-robot | a74954aefecb49654686dc0539ea23cb915c6f4d | [
"MIT"
] | null | null | null | from machine import Pin, PWM
import pycom
import time
class Rotate:
# Servo to fixed position
def __init__(self, pwm):
# Assum 50ms timer already set up and going to reuse
self.pwm = pwm
self.is_active = False
self.at_position = 50
def run(self):
pass
def state... | 30.966102 | 81 | 0.621237 | from machine import Pin, PWM
import pycom
import time
class Rotate:
def __init__(self, pwm):
self.pwm = pwm
self.is_active = False
self.at_position = 50
def run(self):
pass
def state_text(self):
return 'Rotate position = {}'.format(self.at_position)
... | true | true |
f7328dcbb442c75712e43ef7b1e1e4a6045a4a4e | 18,431 | py | Python | megatron/checkpointing.py | adammoody/Megatron-DeepSpeed | 972211163608818fe9e5ba821246f18d0a5dc264 | [
"MIT"
] | null | null | null | megatron/checkpointing.py | adammoody/Megatron-DeepSpeed | 972211163608818fe9e5ba821246f18d0a5dc264 | [
"MIT"
] | null | null | null | megatron/checkpointing.py | adammoody/Megatron-DeepSpeed | 972211163608818fe9e5ba821246f18d0a5dc264 | [
"MIT"
] | null | null | null | # coding=utf-8
# 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 re... | 39.980477 | 95 | 0.629646 |
import os
import random
import sys
import numpy as np
import torch
from megatron.global_vars import codecarbon_tracker_flush
from megatron import (get_args,
mpu,
print_rank_0,
update_num_microbatches,
utils)
_CHECKPOINT_VERSION... | true | true |
f7328e07aa94a65699960aed21b01b92175dfc88 | 1,011 | py | Python | random_stuff/telnetlib_logging.py | adw1n/competitive-programming | b28a166e7c93d7b239c0a6b09eafd6020685afdf | [
"WTFPL"
] | null | null | null | random_stuff/telnetlib_logging.py | adw1n/competitive-programming | b28a166e7c93d7b239c0a6b09eafd6020685afdf | [
"WTFPL"
] | null | null | null | random_stuff/telnetlib_logging.py | adw1n/competitive-programming | b28a166e7c93d7b239c0a6b09eafd6020685afdf | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python3
import telnetlib
import struct
import logging
HOST="localhost"
#while true; do nc -l -p 1111 -e /tmp/vuln; done
old_write=telnetlib.Telnet.write
def write(self, str_: bytes):
try:
print("w: ",str_.decode("utf-8"))
except UnicodeDecodeError:
print("w: ",str_)
old_writ... | 23.511628 | 61 | 0.67458 | import telnetlib
import struct
import logging
HOST="localhost"
old_write=telnetlib.Telnet.write
def write(self, str_: bytes):
try:
print("w: ",str_.decode("utf-8"))
except UnicodeDecodeError:
print("w: ",str_)
old_write(self,str_)
telnetlib.Telnet.write=write
old_read_until=telnetlib.Telne... | true | true |
f7328e7d8e965d4fc8718dd18bf2b119145af16a | 9,759 | py | Python | platform/gsutil/third_party/boto/tests/unit/utils/test_utils.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 1 | 2021-04-30T05:26:20.000Z | 2021-04-30T05:26:20.000Z | platform/gsutil/third_party/boto/tests/unit/utils/test_utils.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | platform/gsutil/third_party/boto/tests/unit/utils/test_utils.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 2 | 2020-07-25T05:03:06.000Z | 2020-11-04T04:55:57.000Z | # Copyright (c) 2010 Robert Mela
#
# 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, dis-
# ... | 33.307167 | 81 | 0.650579 | try:
import unittest2 as unittest
except ImportError:
import unittest
import datetime
import hashlib
import hmac
import locale
import mock
import thread
import time
import boto.utils
from boto.utils import Password
from boto.utils import pythonize_name
from boto.utils import _build_instance_metadata_url
from ... | true | true |
f7328f2ec786dc897da0bb3735ef8a755cd94bc3 | 772 | py | Python | Armadillo-IoT_GW/modules/reporters/temperature_reporter.py | naomitodori/Azure-IoT-samples | f98ad55eaab0d3fe52a5ff17a8d312aa69df0cce | [
"MIT"
] | 3 | 2021-08-01T00:31:50.000Z | 2021-12-15T23:42:52.000Z | Armadillo-IoT_GW/modules/reporters/temperature_reporter.py | naomitodori/Azure-IoT-samples | f98ad55eaab0d3fe52a5ff17a8d312aa69df0cce | [
"MIT"
] | null | null | null | Armadillo-IoT_GW/modules/reporters/temperature_reporter.py | naomitodori/Azure-IoT-samples | f98ad55eaab0d3fe52a5ff17a8d312aa69df0cce | [
"MIT"
] | 3 | 2021-12-07T13:18:44.000Z | 2022-01-28T00:41:46.000Z | from modules.lib.reporter import Reporter
from modules.lib.report import Report
from modules.lib.alarm_machine import AlarmMachine
class TemperatureReporter(Reporter):
def data_type(self):
return 'temperature'
def report(self):
with open('/sys/class/thermal/thermal_zone0/temp') as file:
... | 29.692308 | 67 | 0.576425 | from modules.lib.reporter import Reporter
from modules.lib.report import Report
from modules.lib.alarm_machine import AlarmMachine
class TemperatureReporter(Reporter):
def data_type(self):
return 'temperature'
def report(self):
with open('/sys/class/thermal/thermal_zone0/temp') as file:
... | true | true |
f73290c0fd0677b07fe0cd79a344a6e52fbf148d | 733 | py | Python | setup.py | consideRatio/the-littlest-jupyterhub | 9179365a4ff9d5642a12df09b6d0b4271097fed6 | [
"BSD-3-Clause"
] | null | null | null | setup.py | consideRatio/the-littlest-jupyterhub | 9179365a4ff9d5642a12df09b6d0b4271097fed6 | [
"BSD-3-Clause"
] | 1 | 2021-04-07T13:16:00.000Z | 2021-04-07T13:16:00.000Z | setup.py | consideRatio/the-littlest-jupyterhub | 9179365a4ff9d5642a12df09b6d0b4271097fed6 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='the-littlest-jupyterhub',
version='0.1',
description='A small JupyterHub distribution',
url='https://github.com/jupyterhub/the-littlest-jupyterhub',
author='Jupyter Development Team',
author_email='jupyter@googlegroups.com',
license='... | 25.275862 | 64 | 0.594816 | from setuptools import setup, find_packages
setup(
name='the-littlest-jupyterhub',
version='0.1',
description='A small JupyterHub distribution',
url='https://github.com/jupyterhub/the-littlest-jupyterhub',
author='Jupyter Development Team',
author_email='jupyter@googlegroups.com',
license='... | true | true |
f73290d84c37138805df43d4dc3c217150c2e691 | 11,133 | py | Python | brain.py | hugodemenez/HistoricalMemoryTradingAlgorithm | d51d14632d0ffade27383bb8672c2ece450665a2 | [
"MIT"
] | null | null | null | brain.py | hugodemenez/HistoricalMemoryTradingAlgorithm | d51d14632d0ffade27383bb8672c2ece450665a2 | [
"MIT"
] | null | null | null | brain.py | hugodemenez/HistoricalMemoryTradingAlgorithm | d51d14632d0ffade27383bb8672c2ece450665a2 | [
"MIT"
] | null | null | null | r"""
Ce programme sert à ouvrir, gérer et fermer les positions.
Enregistre les positions dans la base de données et dans un fichier excel,
les affiches dans le terminal puis envoie une notification au groupe telegram
"""
import time,datetime,os,sys,requests
from brokerconnection import realcommands
from prediction im... | 34.790625 | 223 | 0.633971 | import time,datetime,os,sys,requests
from brokerconnection import realcommands
from prediction import Prediction
from settings import Settings
from database import Database
from position import Position
from csv_generator import csv_generator
Position=Position()
Settings=Settings()
Database=Database()
def current_s... | true | true |
f73291c826cb60dbd0831bf1e0263014829f7443 | 1,399 | py | Python | fastreid/layers/cos_softmax.py | tycallen/fast-reid | 66683fa95bc7d7222659e8db3ac04e5b8e366190 | [
"Apache-2.0"
] | 19 | 2021-09-10T02:16:29.000Z | 2022-03-27T12:47:46.000Z | fastreid/layers/cos_softmax.py | tycallen/fast-reid | 66683fa95bc7d7222659e8db3ac04e5b8e366190 | [
"Apache-2.0"
] | 5 | 2021-09-27T03:52:12.000Z | 2021-12-29T09:13:40.000Z | fastreid/layers/cos_softmax.py | tycallen/fast-reid | 66683fa95bc7d7222659e8db3ac04e5b8e366190 | [
"Apache-2.0"
] | 3 | 2021-12-23T16:44:44.000Z | 2022-03-27T12:47:47.000Z | # encoding: utf-8
"""
@author: xingyu liao
@contact: sherlockliao01@gmail.com
"""
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Parameter
class CosSoftmax(nn.Module):
r"""Implement of large margin cosine distance:
Args:
in_feat: size of each input sample
... | 31.795455 | 90 | 0.584703 |
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Parameter
class CosSoftmax(nn.Module):
def __init__(self, cfg, in_feat, num_classes):
super().__init__()
self.in_features = in_feat
self._num_classes = num_classes
self.s = cfg.MODEL.HEADS.SCAL... | true | true |
f732945508b4f5b0ce0dabe10f16e4ac669fd278 | 92 | py | Python | myapp/app.py | cwg83/cgoodale.com-flask | 50a18585e8d0e2ae31bfb12ed552e1c5089094c2 | [
"CC0-1.0"
] | null | null | null | myapp/app.py | cwg83/cgoodale.com-flask | 50a18585e8d0e2ae31bfb12ed552e1c5089094c2 | [
"CC0-1.0"
] | null | null | null | myapp/app.py | cwg83/cgoodale.com-flask | 50a18585e8d0e2ae31bfb12ed552e1c5089094c2 | [
"CC0-1.0"
] | null | null | null | from calblog import app
if __name__ == '__main__':
app.run(port=34630, debug=True)
| 10.222222 | 35 | 0.673913 | from calblog import app
if __name__ == '__main__':
app.run(port=34630, debug=True)
| true | true |
f73294872a3d8143e1add44fe880ba57f1fac308 | 2,252 | py | Python | mlapp/integrations/aml/scripts/publish_multisteps_pipeline.py | nbk905/mlapp | af650a8a302959674dd5a1bc6d15e30e90abf227 | [
"Apache-2.0"
] | null | null | null | mlapp/integrations/aml/scripts/publish_multisteps_pipeline.py | nbk905/mlapp | af650a8a302959674dd5a1bc6d15e30e90abf227 | [
"Apache-2.0"
] | null | null | null | mlapp/integrations/aml/scripts/publish_multisteps_pipeline.py | nbk905/mlapp | af650a8a302959674dd5a1bc6d15e30e90abf227 | [
"Apache-2.0"
] | null | null | null | from azureml.data.data_reference import DataReference
from azureml.pipeline.core import PipelineData
from mlapp.integrations.aml.utils.compute import get_or_create_compute_target
from mlapp.integrations.aml.utils.constants import OUTPUT_PATH_ON_COMPUTE, DATA_REFERENCE_NAME
from mlapp.integrations.aml.utils.pipeline im... | 35.1875 | 103 | 0.654085 | from azureml.data.data_reference import DataReference
from azureml.pipeline.core import PipelineData
from mlapp.integrations.aml.utils.compute import get_or_create_compute_target
from mlapp.integrations.aml.utils.constants import OUTPUT_PATH_ON_COMPUTE, DATA_REFERENCE_NAME
from mlapp.integrations.aml.utils.pipeline im... | true | true |
f732951c2a10f606835e6edf4dd28492d430def9 | 4,455 | py | Python | aggregator.py | lorrainewongmw/synthetic-data-showcase | c686478e5b58e3a2bc0e3bdd6d6f5c7a8378ff5d | [
"MIT"
] | null | null | null | aggregator.py | lorrainewongmw/synthetic-data-showcase | c686478e5b58e3a2bc0e3bdd6d6f5c7a8378ff5d | [
"MIT"
] | null | null | null | aggregator.py | lorrainewongmw/synthetic-data-showcase | c686478e5b58e3a2bc0e3bdd6d6f5c7a8378ff5d | [
"MIT"
] | null | null | null | import time
import datetime
import logging
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from os import path
import util as util
def aggregate(config):
"""Aggregates the sensitive microdata at sensitive_microdata_path.
Produces the reportable_agg... | 47.903226 | 180 | 0.700561 | import time
import datetime
import logging
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from os import path
import util as util
def aggregate(config):
use_columns = config['use_columns']
reporting_length = config['reporting_length']
reportin... | true | true |
f73295e0bdf841a082ee62af3dfeefbf417d5f78 | 2,131 | py | Python | src/wormhole/server/cmd_server.py | LeastAuthority/magic-wormhole | 2fadadc4dba78f167cfc1295bbea7ee778d22dd5 | [
"MIT"
] | null | null | null | src/wormhole/server/cmd_server.py | LeastAuthority/magic-wormhole | 2fadadc4dba78f167cfc1295bbea7ee778d22dd5 | [
"MIT"
] | null | null | null | src/wormhole/server/cmd_server.py | LeastAuthority/magic-wormhole | 2fadadc4dba78f167cfc1295bbea7ee778d22dd5 | [
"MIT"
] | null | null | null | from __future__ import print_function, unicode_literals
import os, time
from twisted.python import usage
from twisted.scripts import twistd
class MyPlugin(object):
tapname = "xyznode"
def __init__(self, args):
self.args = args
def makeService(self, so):
# delay this import as late as poss... | 29.191781 | 78 | 0.632098 | from __future__ import print_function, unicode_literals
import os, time
from twisted.python import usage
from twisted.scripts import twistd
class MyPlugin(object):
tapname = "xyznode"
def __init__(self, args):
self.args = args
def makeService(self, so):
# accept --reactor= selecti... | true | true |
f7329645c63bbeced2675087da6bdc4f97ad2b38 | 14,433 | py | Python | src/spaceone/inventory/libs/schema/dynamic_field.py | xellos00/plugin-aws-cloud-services | 56ac9d6f2edafc5abcd236c046726f169a72e1f6 | [
"Apache-2.0"
] | 2 | 2020-06-22T09:49:22.000Z | 2021-01-03T22:21:27.000Z | src/spaceone/inventory/libs/schema/dynamic_field.py | xellos00/plugin-aws-cloud-services | 56ac9d6f2edafc5abcd236c046726f169a72e1f6 | [
"Apache-2.0"
] | 2 | 2020-07-20T01:58:32.000Z | 2020-08-04T07:41:37.000Z | src/spaceone/inventory/libs/schema/dynamic_field.py | xellos00/plugin-aws-cloud-services | 56ac9d6f2edafc5abcd236c046726f169a72e1f6 | [
"Apache-2.0"
] | 5 | 2020-10-13T15:05:12.000Z | 2021-04-19T10:25:24.000Z | import math
from schematics import Model
from schematics.types import ModelType, StringType, PolyModelType, DictType, ListType, BooleanType
from .dynamic_search import BaseDynamicSearch
BACKGROUND_COLORS = [
'black', 'white',
'gray', 'gray.100', 'gray.200', 'gray.300', 'gray.400', 'gray.500', 'gray.600', 'gra... | 36.355164 | 149 | 0.655304 | import math
from schematics import Model
from schematics.types import ModelType, StringType, PolyModelType, DictType, ListType, BooleanType
from .dynamic_search import BaseDynamicSearch
BACKGROUND_COLORS = [
'black', 'white',
'gray', 'gray.100', 'gray.200', 'gray.300', 'gray.400', 'gray.500', 'gray.600', 'gra... | true | true |
f732973ab5e14dcb0ef39a1adb7dc2e525a39b6e | 3,963 | py | Python | tests/sentry/manager/tests.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/sentry/manager/tests.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/manager/tests.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.models import Group, Project, Team, User
from sentry.testutils import TestCase
class SentryManagerTest(TestCase):
def test_valid_only_message(self):
event = Group.objects.from_kwargs(1, message="foo")
self.assertEquals(event.group.last_seen, even... | 41.28125 | 93 | 0.671209 | from __future__ import absolute_import
from sentry.models import Group, Project, Team, User
from sentry.testutils import TestCase
class SentryManagerTest(TestCase):
def test_valid_only_message(self):
event = Group.objects.from_kwargs(1, message="foo")
self.assertEquals(event.group.last_seen, even... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.