hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ba680b337536a0899da39efb0075e06a8b4af84f | 8,539 | py | Python | pytorch_tabnet/sparsemax.py | miguel-bm/tabnet | 0f5e6a5c88b175591a8e5f01b00f9c6f144a708f | [
"MIT"
] | 1 | 2021-01-10T11:23:55.000Z | 2021-01-10T11:23:55.000Z | pytorch_tabnet/sparsemax.py | vibhatha/tabnet | 2a9757d4002e7ba6117e53d140581147e651ab24 | [
"MIT"
] | null | null | null | pytorch_tabnet/sparsemax.py | vibhatha/tabnet | 2a9757d4002e7ba6117e53d140581147e651ab24 | [
"MIT"
] | null | null | null | from torch import nn
from torch.autograd import Function
import torch.nn.functional as F
import torch
"""
Other possible implementations:
https://github.com/KrisKorrel/sparsemax-pytorch/blob/master/sparsemax.py
https://github.com/msobroza/SparsemaxPytorch/blob/master/mnist/sparsemax.py
https://github.com/vene/sparse-... | 30.605735 | 100 | 0.619276 |
67d4135a7c7d2a7fc40efa75d5dcfb741f18770d | 1,333 | py | Python | Python/Flask_Bootcamp_Portilla/Flask-Bootcamp-master/05-Databases/02-Relationships/populate_database.py | RMDircio/Udemy_Courses | 9f00397e7a4ef54866e83e42e3f0a623fbf0a86d | [
"MIT"
] | 1 | 2021-01-31T22:53:05.000Z | 2021-01-31T22:53:05.000Z | Python/Flask_Bootcamp_Portilla/Flask-Bootcamp-master/05-Databases/02-Relationships/populate_database.py | RMDircio/Udemy_Courses | 9f00397e7a4ef54866e83e42e3f0a623fbf0a86d | [
"MIT"
] | null | null | null | Python/Flask_Bootcamp_Portilla/Flask-Bootcamp-master/05-Databases/02-Relationships/populate_database.py | RMDircio/Udemy_Courses | 9f00397e7a4ef54866e83e42e3f0a623fbf0a86d | [
"MIT"
] | null | null | null | # This script will create some puppies, owners, and toys!
# Note, if you run this more than once, you'll be creating dogs with the same
# name and duplicate owners. The script will still work, but you'll see some
# warnings. Watch the video for the full explanation.
from models import db,Puppy,Owner,Toy
# Create 2 pup... | 28.361702 | 77 | 0.727682 |
04fe2d78b04f39ea3284ecf060895734410b40d6 | 622 | py | Python | src/common/owner.py | gruyaume/my-blockchain | 283f5ef0c8c09eff0478dfead3950c720cda2882 | [
"Apache-2.0"
] | 4 | 2021-11-14T17:16:03.000Z | 2022-03-17T21:01:42.000Z | src/common/owner.py | gruyaume/my-blockchain | 283f5ef0c8c09eff0478dfead3950c720cda2882 | [
"Apache-2.0"
] | null | null | null | src/common/owner.py | gruyaume/my-blockchain | 283f5ef0c8c09eff0478dfead3950c720cda2882 | [
"Apache-2.0"
] | 5 | 2021-07-30T14:27:37.000Z | 2021-12-15T12:08:46.000Z | import binascii
from Crypto.PublicKey import RSA
from common.utils import calculate_hash
class Owner:
def __init__(self, private_key: str = ""):
if private_key:
self.private_key = RSA.importKey(private_key)
else:
self.private_key = RSA.generate(2048)
public_key = ... | 34.555556 | 106 | 0.654341 |
adda0d31237c3ff799939caddf656634a655d200 | 561 | py | Python | examples/ml/gpt-2/train.py | ajesse11x/pachyderm | 2e0cd2a840c19c24de3495e5ca9b463a56eb25d6 | [
"Apache-2.0"
] | null | null | null | examples/ml/gpt-2/train.py | ajesse11x/pachyderm | 2e0cd2a840c19c24de3495e5ca9b463a56eb25d6 | [
"Apache-2.0"
] | 1 | 2019-05-14T17:11:28.000Z | 2019-05-14T17:21:28.000Z | examples/ml/gpt-2/train.py | ajesse11x/pachyderm | 2e0cd2a840c19c24de3495e5ca9b463a56eb25d6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import gpt_2_simple as gpt2
import os
tweets = [f for f in os.listdir("/pfs/tweets")]
# chdir so that the training process outputs to the right place
out = os.path.join("/pfs/out", tweets[0])
os.mkdir(out)
# chdir to get gpt2 to output where want it to
os.chdir(out)
model_name = "345M"
gpt2.downl... | 24.391304 | 67 | 0.680927 |
5470254b900acaf5e6c5a7b188b6842aeb3bd731 | 1,960 | py | Python | setup.py | EDUlib/repo-tools | f4e7a8d3a8c450684533001b97824d8858264cd9 | [
"Apache-2.0"
] | null | null | null | setup.py | EDUlib/repo-tools | f4e7a8d3a8c450684533001b97824d8858264cd9 | [
"Apache-2.0"
] | null | null | null | setup.py | EDUlib/repo-tools | f4e7a8d3a8c450684533001b97824d8858264cd9 | [
"Apache-2.0"
] | null | null | null | import setuptools
from setuptools import setup
with open('README.rst') as readme:
long_description = readme.read()
setup(
name='edx-repo-tools',
version='0.3.0',
description="This repo contains a number of tools Open edX uses for working with GitHub repositories.",
long_description=long_descripti... | 35.636364 | 107 | 0.646429 |
927ae40eed327cccaf12e7b7da1e3cfbd8e0d0f0 | 167 | py | Python | src/olympia/github/urls.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | 1 | 2020-12-03T10:02:15.000Z | 2020-12-03T10:02:15.000Z | src/olympia/github/urls.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/github/urls.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from olympia.github.views import GithubView
urlpatterns = [
url(r'^validate/$', GithubView.as_view(), name='github.validate'),
]
| 23.857143 | 70 | 0.736527 |
aeddf8413e6852678efd04b1794fc84a694f6c27 | 1,492 | py | Python | setup.py | Stranger6667/py-offers | 73ef00e7b02ddfa5adc6df282009aea7670e465f | [
"MIT"
] | 17 | 2016-08-26T10:50:44.000Z | 2021-07-08T17:39:34.000Z | setup.py | Stranger6667/py-offers | 73ef00e7b02ddfa5adc6df282009aea7670e465f | [
"MIT"
] | 80 | 2016-08-26T08:45:20.000Z | 2020-08-31T15:47:10.000Z | setup.py | Stranger6667/py-offers | 73ef00e7b02ddfa5adc6df282009aea7670e465f | [
"MIT"
] | 7 | 2017-04-03T08:19:06.000Z | 2020-10-16T19:02:21.000Z | # coding: utf-8
from os import path
from setuptools import find_packages, setup
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.rst")) as fd:
long_description = fd.read()
setup(
name="pyoffers",
url="https://github.com/Stranger6667/pyoffers",
version... | 33.909091 | 70 | 0.645442 |
60513ae5cb1e10375e5274f498a044e809075f70 | 366 | py | Python | app/utils/auth.py | Hoybaby/Python-Project1 | 33336c7303fa4397d3db9d511d1104f01ab32363 | [
"MIT"
] | null | null | null | app/utils/auth.py | Hoybaby/Python-Project1 | 33336c7303fa4397d3db9d511d1104f01ab32363 | [
"MIT"
] | 5 | 2021-03-13T21:40:51.000Z | 2021-03-17T04:36:19.000Z | app/utils/auth.py | Hoybaby/python-newsfeed | 33336c7303fa4397d3db9d511d1104f01ab32363 | [
"MIT"
] | null | null | null | from flask import session, redirect
from functools import wraps
def login_required(func):
@wraps(func)
def wrapped_function(*args, **kwargs):
# if logged in, call original function with original arguments
if session.get('loggedIn') == True:
return func(*args, **kwargs)
return r... | 28.153846 | 66 | 0.680328 |
7480b5e8558893360317a709547b2ce82d3cf83f | 19,961 | py | Python | theprojectname-venv/lib/python3.8/site-packages/piptools/repositories/pypi.py | bonnyjain/theprojectname | 981ac2bb17c9f754b0d773834819aa03ac663082 | [
"MIT"
] | null | null | null | theprojectname-venv/lib/python3.8/site-packages/piptools/repositories/pypi.py | bonnyjain/theprojectname | 981ac2bb17c9f754b0d773834819aa03ac663082 | [
"MIT"
] | null | null | null | theprojectname-venv/lib/python3.8/site-packages/piptools/repositories/pypi.py | bonnyjain/theprojectname | 981ac2bb17c9f754b0d773834819aa03ac663082 | [
"MIT"
] | 1 | 2020-07-25T18:10:11.000Z | 2020-07-25T18:10:11.000Z | # coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import collections
import hashlib
import itertools
import logging
import os
from contextlib import contextmanager
from shutil import rmtree
from pip._internal.cache import WheelCache
from pip._internal.commands import c... | 38.020952 | 88 | 0.614699 |
876b3e6c69f478fffb936bd22dc309891449479c | 12,730 | py | Python | inference/inference/LaserScan.py | slayellow/PointCloudSegmentation_with_Nonpaveload | cafe3ac69da119a6ea1d81f1528bb00320a47642 | [
"MIT"
] | 1 | 2021-10-01T07:24:31.000Z | 2021-10-01T07:24:31.000Z | inference/inference/LaserScan.py | slayellow/PointCloudSegmentation_with_Nonpaveload | cafe3ac69da119a6ea1d81f1528bb00320a47642 | [
"MIT"
] | null | null | null | inference/inference/LaserScan.py | slayellow/PointCloudSegmentation_with_Nonpaveload | cafe3ac69da119a6ea1d81f1528bb00320a47642 | [
"MIT"
] | null | null | null | import numpy as np
import math
import random
from scipy.spatial.transform import Rotation as R
class LaserScan:
"""Class that contains LaserScan with x,y,z,r"""
EXTENSIONS_SCAN = ['.bin']
def __init__(self, project=False, H=64, W=1024, fov_up=3.0, fov_down=-25.0,DA=False,flip_sign=False,rot=False,drop_poi... | 40.412698 | 161 | 0.579104 |
7f611e8321e552e60f3d4d068386fd2f8e440e22 | 2,737 | py | Python | matchms/filtering/clean_compound_name.py | efrain2010/matchms | 69cedeed5597966619a97c4e4211deaf8610d727 | [
"Apache-2.0"
] | null | null | null | matchms/filtering/clean_compound_name.py | efrain2010/matchms | 69cedeed5597966619a97c4e4211deaf8610d727 | [
"Apache-2.0"
] | null | null | null | matchms/filtering/clean_compound_name.py | efrain2010/matchms | 69cedeed5597966619a97c4e4211deaf8610d727 | [
"Apache-2.0"
] | null | null | null | import re
from ..typing import SpectrumType
def clean_compound_name(spectrum_in: SpectrumType) -> SpectrumType:
"""Clean compound name.
A list of frequently seen name additions that do not belong to the compound
name will be removed."""
def remove_parts_by_regular_expression(name):
"""Clean ... | 42.107692 | 109 | 0.596273 |
2aabcd68d49a5d07121205a21df46bc3df568511 | 674 | py | Python | apps/profiles/serializers.py | jhelison/challenge-weef-twitter | 3b3b970d9edd435e780b9747baee944b935eda5c | [
"MIT"
] | null | null | null | apps/profiles/serializers.py | jhelison/challenge-weef-twitter | 3b3b970d9edd435e780b9747baee944b935eda5c | [
"MIT"
] | null | null | null | apps/profiles/serializers.py | jhelison/challenge-weef-twitter | 3b3b970d9edd435e780b9747baee944b935eda5c | [
"MIT"
] | null | null | null | from rest_framework import serializers
from apps.users.serializers import UserSerializer
from apps.users.models import UserFollowing
PROFILE_ACTIONS = ["follow", "unfollow"]
class ProfileActionsSerializer(serializers.Serializer):
action = serializers.ChoiceField(choices=PROFILE_ACTIONS)
class FollowingSerial... | 24.071429 | 61 | 0.752226 |
4b19dc4bdd97601de359ff4c07a9048ac1a0f640 | 626 | py | Python | metrician/configs/cfg.py | tedtroxell/metrician | d4164dbff8db5645ee8beca11dc55ba6c26c4cb6 | [
"MIT"
] | null | null | null | metrician/configs/cfg.py | tedtroxell/metrician | d4164dbff8db5645ee8beca11dc55ba6c26c4cb6 | [
"MIT"
] | null | null | null | metrician/configs/cfg.py | tedtroxell/metrician | d4164dbff8db5645ee8beca11dc55ba6c26c4cb6 | [
"MIT"
] | null | null | null |
class AutoDict(dict):
"""
Allows for JS Object type interaction
Recusrively sets attributes as a dictionary
"""
def __init__(self,**kwargs):
for k,v in kwargs.items():setattr(self,k,v if not isinstance(v, (dict) ) else AutoDict(**v) )
def DefaultCFG(AutoDict) -> AutoDict:
... | 26.083333 | 101 | 0.603834 |
ee12648a6dcb87720b067aedbef5088048f96827 | 2,684 | py | Python | GUI/Dialog/DMachineSetup/SWSlot/PWSlot23/Gen_PWSlot23.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | GUI/Dialog/DMachineSetup/SWSlot/PWSlot23/Gen_PWSlot23.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | GUI/Dialog/DMachineSetup/SWSlot/PWSlot23/Gen_PWSlot23.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Warning : this file has been generated, you shouldn't edit it"""
from pyleecan.GUI.Dialog.DMachineSetup.SWSlot.PWSlot23.Ui_PWSlot23 import Ui_PWSlot23
class Gen_PWSlot23(Ui_PWSlot23):
def setupUi(self, PWSlot23):
Ui_PWSlot23.setupUi(self, PWSlot23)
# Setup of in_W0
... | 31.209302 | 85 | 0.59389 |
1395ce06aab0e09370644215c60c1a26ce923f3e | 7,701 | py | Python | python/tink/jwt/_jwt_hmac_key_manager_test.py | Rina-Tokhi/tink | a72c9d542cd1dd8b58b2620ab52585cf5544f212 | [
"Apache-2.0"
] | 1 | 2021-05-26T18:18:43.000Z | 2021-05-26T18:18:43.000Z | python/tink/jwt/_jwt_hmac_key_manager_test.py | Rina-Tokhi/tink | a72c9d542cd1dd8b58b2620ab52585cf5544f212 | [
"Apache-2.0"
] | null | null | null | python/tink/jwt/_jwt_hmac_key_manager_test.py | Rina-Tokhi/tink | a72c9d542cd1dd8b58b2620ab52585cf5544f212 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 41.853261 | 80 | 0.733152 |
a80c0fa2ab6f49391d8e0a2568343c6b0ae8237e | 524 | py | Python | dev/tag.py | garstka/idact-test-environment | a9b430636f5198de7f3c5de517ab93b9b57c6ca6 | [
"MIT"
] | null | null | null | dev/tag.py | garstka/idact-test-environment | a9b430636f5198de7f3c5de517ab93b9b57c6ca6 | [
"MIT"
] | null | null | null | dev/tag.py | garstka/idact-test-environment | a9b430636f5198de7f3c5de517ab93b9b57c6ca6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import subprocess
WORKING_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), '../'))
TAG_NAME_SCRIPT = "dev/tag_name"
TAG_MESSAGE_SCRIPT = "dev/tag_message"
def main():
"""Main script function."""
os.chdir(WORKING_DIR)
tag_name = subprocess.check_output([TAG_... | 24.952381 | 78 | 0.70229 |
df6a06df6e7b4711beb8c74f419252c3f864f5d8 | 2,064 | py | Python | Hapi/__init__.py | gitter-badger/Hapi-1 | 334c83bdc7d7302d111034e642fbc3fc590cf3a3 | [
"MIT"
] | null | null | null | Hapi/__init__.py | gitter-badger/Hapi-1 | 334c83bdc7d7302d111034e642fbc3fc590cf3a3 | [
"MIT"
] | null | null | null | Hapi/__init__.py | gitter-badger/Hapi-1 | 334c83bdc7d7302d111034e642fbc3fc590cf3a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue May 22 09:01:55 2018
@author: Mostafa
"""
# documentation format
__author__ = 'Mostafa Farrag'
__version__ = '0.3.0'
__docformat__ = 'restructuredtext'
# Let users know if they're missing any of our hard dependencies
hard_dependencies = () #("numpy", "pandas", "gdal")
missi... | 26.461538 | 84 | 0.758236 |
db9d60264a1a9905d6252dc8b5a7de3f10d58fbe | 4,040 | py | Python | scripts/get_statusAliases.py | naojsoft/oscript | a4d3862ac06e571075fd3ad01c94b320f0c54464 | [
"BSD-3-Clause"
] | null | null | null | scripts/get_statusAliases.py | naojsoft/oscript | a4d3862ac06e571075fd3ad01c94b320f0c54464 | [
"BSD-3-Clause"
] | null | null | null | scripts/get_statusAliases.py | naojsoft/oscript | a4d3862ac06e571075fd3ad01c94b320f0c54464 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python3
#
"""
Program to get the list of status aliases used by an instrument in SOSS
compatibility mode. Run like this:
$ ./get_statusAliases.py --ins=SPCAM
You can further restrict the scan by judicious use of --mode and --file
flags. These work the same as for testfunc_sk_parser (whose classe... | 29.705882 | 82 | 0.622772 |
3ddbbe9286bc84b5a60321fcb77c1cb051a5f2b5 | 6,373 | py | Python | tests/sentry/api/endpoints/test_group_integration_details.py | andrzej-tests-1/sentry.app | c863b8c5f9a4ed38a5fa817d28f610cd3c47b9f3 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/api/endpoints/test_group_integration_details.py | andrzej-tests-1/sentry.app | c863b8c5f9a4ed38a5fa817d28f610cd3c47b9f3 | [
"BSD-3-Clause"
] | 4 | 2020-09-05T14:32:35.000Z | 2021-05-09T17:26:50.000Z | tests/sentry/api/endpoints/test_group_integration_details.py | andrzej-tests-1/sentry.app | c863b8c5f9a4ed38a5fa817d28f610cd3c47b9f3 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import six
from sentry.models import ExternalIssue, GroupLink, Integration
from sentry.testutils import APITestCase
from sentry.utils.http import absolute_uri
class GroupIntegrationDetailsTest(APITestCase):
def test_simple_get_link(self):
self.login_as(user=self.us... | 35.209945 | 97 | 0.565825 |
5bd0045c84cefae9757175ad17c00eeb1ec043c7 | 938 | py | Python | apollo/admin.py | dbroudy/django-apollo | bdfc70580bd6c9bf7c0a48bce10500a05467e507 | [
"MIT"
] | 8 | 2015-06-19T15:31:17.000Z | 2020-02-12T06:57:42.000Z | apollo/admin.py | dbroudy/django-apollo | bdfc70580bd6c9bf7c0a48bce10500a05467e507 | [
"MIT"
] | null | null | null | apollo/admin.py | dbroudy/django-apollo | bdfc70580bd6c9bf7c0a48bce10500a05467e507 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.utils.safestring import mark_safe
from django import forms
from apollo import models
class AnswerInline(admin.TabularInline):
model = models.Answer
extra = 0
class QuestionAdmin(admin.ModelAdmin):
inlines = [AnswerInline]
admin.site.register(models.Question, Quest... | 24.051282 | 51 | 0.770789 |
cf58aa553672fa49f3c04892358793c652b93bbc | 5,533 | py | Python | pyqvrpro/client.py | trunet/pyqvrpro | f264b5a32adfa7bc506925285fd62416d901147f | [
"MIT"
] | 1 | 2019-03-11T07:43:25.000Z | 2019-03-11T07:43:25.000Z | pyqvrpro/client.py | trunet/pyqvrpro | f264b5a32adfa7bc506925285fd62416d901147f | [
"MIT"
] | 4 | 2020-03-22T01:35:04.000Z | 2021-09-02T19:51:13.000Z | pyqvrpro/client.py | trunet/pyqvrpro | f264b5a32adfa7bc506925285fd62416d901147f | [
"MIT"
] | 1 | 2021-09-02T19:38:04.000Z | 2021-09-02T19:38:04.000Z | import base64
import requests
import untangle
API_VERSION = '1.1.0'
class Client(object):
def __init__(self, user, password, host, protocol='http', port=8080):
"""Initialize QVR client."""
self._user = user
self._password = password
self._host = host
self._protocol = prot... | 27.122549 | 79 | 0.592445 |
7d8472affa7690de0b42e8f183a0d76244f4047d | 3,409 | py | Python | edg_core/test_range.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | edg_core/test_range.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | edg_core/test_range.py | tengisd/PolymorphicBlocks | 240a11f813762c4eb5a97c9d9766a0af19cd8f3a | [
"BSD-3-Clause"
] | null | null | null | import math
import unittest
from . import Range
class RangeTestCase(unittest.TestCase):
def test_range_contains(self) -> None:
self.assertTrue(0.5 in Range(0, 1))
self.assertTrue(Range(0, 1) in Range(0, 1))
self.assertFalse(Range(0, 1.1) in Range(0, 1))
def test_range_tolerance(self) -> None:
se... | 40.105882 | 94 | 0.654151 |
e6b8d409c076f279a71d14ce53f905b2e616f8bb | 319 | py | Python | tutorial/demo.py | viz4biz/PyDataNYC2015 | 066154ea9f1837c355e6108a28b85889f3020da3 | [
"Apache-2.0"
] | 11 | 2015-11-11T13:57:21.000Z | 2019-08-14T15:53:43.000Z | tutorial/demo.py | viz4biz/PyDataNYC2015 | 066154ea9f1837c355e6108a28b85889f3020da3 | [
"Apache-2.0"
] | null | null | null | tutorial/demo.py | viz4biz/PyDataNYC2015 | 066154ea9f1837c355e6108a28b85889f3020da3 | [
"Apache-2.0"
] | 6 | 2015-11-11T13:57:25.000Z | 2018-09-12T07:53:03.000Z | """
Demo
"""
import enaml
from enaml.qt.qt_application import QtApplication
def run_demo():
with enaml.imports():
from demo_ui import Main
app = QtApplication()
view = Main(message='Hello World, from Python!')
view.show()
# Start the application event loop
app.start()
run_demo() | 14.5 | 52 | 0.658307 |
6064d388c963b79fd50e9a8e3438518fdc5b6a7a | 1,231 | py | Python | OpenGLCffi/GL/EXT/NV/evaluators.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | OpenGLCffi/GL/EXT/NV/evaluators.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | OpenGLCffi/GL/EXT/NV/evaluators.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | from OpenGLCffi.GL import params
@params(api='gl', prms=['target', 'index', 'type', 'ustride', 'vstride', 'uorder', 'vorder', 'packed', 'points'])
def glMapControlPointsNV(target, index, type, ustride, vstride, uorder, vorder, packed, points):
pass
@params(api='gl', prms=['target', 'pname', 'params'])
def glMapParam... | 26.191489 | 113 | 0.686434 |
26a6f99a07d2e028b702d89b26d7cb537d844714 | 4,077 | py | Python | templates/AppPortrait/PyApp/app/src/main/assets/python/stdlib/sysconfig.py | wxh0000mm/TKinterDesigner | 01878e78746082413a09444283edbd52118d15ef | [
"Apache-2.0"
] | 1 | 2022-03-09T08:43:41.000Z | 2022-03-09T08:43:41.000Z | templates/AppPortrait/PyApp/app/src/main/assets/python/stdlib/sysconfig.py | wxh0000mm/TKinterDesigner | 01878e78746082413a09444283edbd52118d15ef | [
"Apache-2.0"
] | null | null | null | templates/AppPortrait/PyApp/app/src/main/assets/python/stdlib/sysconfig.py | wxh0000mm/TKinterDesigner | 01878e78746082413a09444283edbd52118d15ef | [
"Apache-2.0"
] | null | null | null | """Access to Python's configuration information."""
import os
import sys
import os.path
__all__ = [
'get_config_var',
'get_config_vars',
'get_path',
'get_path_names',
'get_paths',
'get_platform',
'get_python_version',
'get_scheme_names',
]
_INSTALL_SCHEMES = {
'bundled': {
... | 24.859756 | 77 | 0.64729 |
48e818fa7ef4308666bf60a7c9fec668e45b90c5 | 132,010 | py | Python | python/ccxt/bybit.py | Insmael/ccxt | cca3dcbfc50b016c8707f1f7c73dd645ece0dbee | [
"MIT"
] | null | null | null | python/ccxt/bybit.py | Insmael/ccxt | cca3dcbfc50b016c8707f1f7c73dd645ece0dbee | [
"MIT"
] | null | null | null | python/ccxt/bybit.py | Insmael/ccxt | cca3dcbfc50b016c8707f1f7c73dd645ece0dbee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 45.364261 | 471 | 0.454564 |
67cf7b2aab72e752c164c6d49dab3cc1b971643f | 2,050 | py | Python | usaspending_api/disaster/tests/fixtures/agency_count_data.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | 217 | 2016-11-03T17:09:53.000Z | 2022-03-10T04:17:54.000Z | usaspending_api/disaster/tests/fixtures/agency_count_data.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | 622 | 2016-09-02T19:18:23.000Z | 2022-03-29T17:11:01.000Z | usaspending_api/disaster/tests/fixtures/agency_count_data.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | 93 | 2016-09-07T20:28:57.000Z | 2022-02-25T00:25:27.000Z | import pytest
from model_mommy import mommy
from usaspending_api.references.models import DisasterEmergencyFundCode
from usaspending_api.submissions.models import SubmissionAttributes
from usaspending_api.references.models import Agency
@pytest.fixture
def faba_with_toptier_agencies(award_count_sub_schedule, award_... | 32.03125 | 119 | 0.770732 |
6e9000ef658dcc3178d660dda09b897dee44c51f | 2,405 | py | Python | mir/commands/log.py | fenrir-z/ymir-cmd | 6fbffd3c1ff5dd1c9a44b55de411523b50567661 | [
"Apache-2.0"
] | 1 | 2022-01-12T03:12:47.000Z | 2022-01-12T03:12:47.000Z | mir/commands/log.py | fenrir-z/ymir-cmd | 6fbffd3c1ff5dd1c9a44b55de411523b50567661 | [
"Apache-2.0"
] | null | null | null | mir/commands/log.py | fenrir-z/ymir-cmd | 6fbffd3c1ff5dd1c9a44b55de411523b50567661 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
from mir import scm
from mir.commands import base
from mir.tools import checker
from mir.tools.code import MirCode
class CmdLog(base.BaseCommand):
@staticmethod
def run_with_args(mir_root: str,
decorate: bool,
oneline: bool,
... | 38.790323 | 110 | 0.567568 |
2b31c23251d06010b85de31db78f5809363b797d | 2,554 | py | Python | ampel/contrib/gamma/t2/T2ExamplePolyFit.py | RuslanKonno/Ampel-contrib-gamma | c552823f754554d784db157eea8ffd612ea2d0df | [
"BSD-3-Clause"
] | null | null | null | ampel/contrib/gamma/t2/T2ExamplePolyFit.py | RuslanKonno/Ampel-contrib-gamma | c552823f754554d784db157eea8ffd612ea2d0df | [
"BSD-3-Clause"
] | null | null | null | ampel/contrib/gamma/t2/T2ExamplePolyFit.py | RuslanKonno/Ampel-contrib-gamma | c552823f754554d784db157eea8ffd612ea2d0df | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : ampel/contrib/hu/examples/t2/T2ExamplePolyFit.py
# License : BSD-3-Clause
# Author : vb <vbrinnel@physik.hu-berlin.de>
# Date : 10.02.2018
# Last Modified Date: 22.09.2018
# Last Modified By : vb <vbrinnel@physik.hu-b... | 35.971831 | 96 | 0.706343 |
e31a3514161e75b76c4d2e95db9cb27775a60ca9 | 2,104 | py | Python | input-space-partitioning/test-18.py | T-Visor/stripe-checkout | 106aafb36a0a6a4b8ebcf1dbae2e6c001a8e3c33 | [
"MIT"
] | null | null | null | input-space-partitioning/test-18.py | T-Visor/stripe-checkout | 106aafb36a0a6a4b8ebcf1dbae2e6c001a8e3c33 | [
"MIT"
] | null | null | null | input-space-partitioning/test-18.py | T-Visor/stripe-checkout | 106aafb36a0a6a4b8ebcf1dbae2e6c001a8e3c33 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import time
from selenium import webdriver
from selenium.webdriver.support.ui import Select
# payment details
EMAIL = 'akira@persona.com'
CARD_NUMBER = '378282246310005'
CARD_EXPIRY_DATE = '1230'
CARD_VERIFICATION_CODE = '8784'
CARDHOLDER_NAME = 'Akira Ren Kurusu'
COUNTRY = 'Japan'
SCREENSHO... | 23.909091 | 75 | 0.721958 |
fe1cc97f7b6f0e32ef0fc5fb8f247745c5953fda | 1,969 | py | Python | make_rec/gen_datasets_lst.py | awesome-archive/MaskInsightface | b5cad2b330aa2134a7e4aba28af88a6f0fb7905f | [
"Apache-2.0"
] | 269 | 2019-08-20T09:39:44.000Z | 2022-03-12T09:45:29.000Z | make_rec/gen_datasets_lst.py | jianqiangq/MaskInsightface | b5cad2b330aa2134a7e4aba28af88a6f0fb7905f | [
"Apache-2.0"
] | 25 | 2019-08-09T03:58:03.000Z | 2021-12-27T08:22:20.000Z | make_rec/gen_datasets_lst.py | jianqiangq/MaskInsightface | b5cad2b330aa2134a7e4aba28af88a6f0fb7905f | [
"Apache-2.0"
] | 64 | 2019-08-22T08:39:27.000Z | 2022-03-28T14:02:46.000Z | # -*- coding: utf-8 -*
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import argparse
import numpy as np
import random
from time import sleep
sys.path.append(os.path.join(os.path.dirname(__file__), 'common'))
from common import face_im... | 30.765625 | 97 | 0.629253 |
c7869498b4ba61aad7aaaae492c5c9642ac2c223 | 1,431 | py | Python | datashader/pandas.py | wxbn/datashader | 09108467658d7a905f44db5d0d3b58131ab956dd | [
"BSD-3-Clause"
] | null | null | null | datashader/pandas.py | wxbn/datashader | 09108467658d7a905f44db5d0d3b58131ab956dd | [
"BSD-3-Clause"
] | null | null | null | datashader/pandas.py | wxbn/datashader | 09108467658d7a905f44db5d0d3b58131ab956dd | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division
import pandas as pd
from .core import bypixel
from .compiler import compile_components
from .glyphs import _PointLike, _AreaToLineLike
from .utils import Dispatcher
__all__ = ()
@bypixel.pipeline.register(pd.DataFrame)
def pandas_pipeline(df, schema, canvas, glyph, ... | 30.446809 | 82 | 0.737247 |
a473ae47ae8f3595220303dfaef92f95e9935f18 | 2,003 | py | Python | api/api/providers/views.py | VidroX/stockii | 237f30aa4b3b061bc0e9a1362c7ab66375feb59e | [
"Apache-2.0"
] | null | null | null | api/api/providers/views.py | VidroX/stockii | 237f30aa4b3b061bc0e9a1362c7ab66375feb59e | [
"Apache-2.0"
] | null | null | null | api/api/providers/views.py | VidroX/stockii | 237f30aa4b3b061bc0e9a1362c7ab66375feb59e | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import get_object_or_404
from rest_framework import generics, filters
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import IsAuthenticated, IsAdminUser
from rest_framework.response import Response
from api.permissions import SuperUserCreateOnly
... | 34.534483 | 112 | 0.614578 |
842b05f87a4cd39bcb0df08c5077f44b7aefaa2e | 338 | py | Python | modules/security/_PrefabDropbear.py | threefoldtech/jumpscale_prefab9 | 75cb6267618d9087d4a9a7eaad121a14e497f07d | [
"Apache-2.0"
] | null | null | null | modules/security/_PrefabDropbear.py | threefoldtech/jumpscale_prefab9 | 75cb6267618d9087d4a9a7eaad121a14e497f07d | [
"Apache-2.0"
] | 31 | 2018-07-31T15:40:07.000Z | 2019-02-20T11:07:15.000Z | modules/security/_PrefabDropbear.py | threefoldtech/jumpscale_prefab | 75cb6267618d9087d4a9a7eaad121a14e497f07d | [
"Apache-2.0"
] | null | null | null |
from jumpscale import j
base = j.tools.prefab._getBaseClass()
class PrefabDropbear(base):
def build(self):
url = "https://matt.ucc.asn.au/dropbear/releases/dropbear-2016.74.tar.bz2"
from IPython import embed
self.logger.info("DEBUG NOW uuuy")
embed()
raise RuntimeError("... | 22.533333 | 82 | 0.659763 |
0445f2808fc4a469dac60f4586ea3e38e344d5ea | 1,838 | py | Python | GUI/Cocoa/BaseFileDialogs.py | gcewing/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 9 | 2019-07-15T19:03:27.000Z | 2021-11-24T19:50:02.000Z | GUI/Cocoa/BaseFileDialogs.py | mnabeelp/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 3 | 2019-09-11T13:22:10.000Z | 2020-08-19T20:13:00.000Z | GUI/Cocoa/BaseFileDialogs.py | mnabeelp/PyGUI | 58c6c38ccb8e66acdf98dea6b24bef1d9a03147c | [
"MIT"
] | 4 | 2020-02-23T16:50:06.000Z | 2022-02-10T07:15:35.000Z | #
# Python GUI - File selection dialogs - Cocoa
#
from AppKit import NSOpenPanel, NSSavePanel, NSOKButton
from GUI.Files import FileRef
from GUI import application
#------------------------------------------------------------------
def _request_old(prompt, default_dir, file_types, dir, multiple):
ns_panel = NSOpe... | 28.71875 | 75 | 0.695321 |
a24b27c894d8ef0ca3029c7807935879802fa16c | 1,605 | py | Python | new_package/seed/generate_sync_asdf_specfem.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | new_package/seed/generate_sync_asdf_specfem.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | new_package/seed/generate_sync_asdf_specfem.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | """
generate sync asdf file from a Specfem3D directory. Just read in all the sac files and eventxml file.
"""
from os.path import join
import obspy
import pyasdf
def convert_sync_to_asdf(specfem_directory, output_path, with_mpi):
sync_directory = join(specfem_directory, "OUTPUT_FILES")
cmt_file = join(specfem... | 32.755102 | 124 | 0.701558 |
96a448f7416f4212885a0c866c0e95dbd1a7da97 | 683 | py | Python | registration/migrations/0009_auto_20180808_1216.py | allenallen/intered-web | 1dfed88081f38df6cef2d873cd3c6f6fee31dffd | [
"MIT"
] | null | null | null | registration/migrations/0009_auto_20180808_1216.py | allenallen/intered-web | 1dfed88081f38df6cef2d873cd3c6f6fee31dffd | [
"MIT"
] | 6 | 2020-02-11T23:05:13.000Z | 2021-06-10T20:43:51.000Z | registration/migrations/0009_auto_20180808_1216.py | allenallen/intered-web | 1dfed88081f38df6cef2d873cd3c6f6fee31dffd | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2018-08-08 12:16
import django.core.files.storage
from django.db import migrations, models
import registration.models
class Migration(migrations.Migration):
dependencies = [
('registration', '0008_auto_20180808_1200'),
]
operations = [
migrations.AlterField(... | 32.52381 | 287 | 0.702782 |
b8604d5810f69e11eb475d212a2cfde606ccab21 | 1,903 | py | Python | dubhe-visual-server/service_utils/utils/redis_utils.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-01-11T07:14:37.000Z | 2022-01-11T07:14:37.000Z | dubhe-visual-server/service_utils/utils/redis_utils.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-03-04T07:19:43.000Z | 2022-03-04T07:19:43.000Z | dubhe-visual-server/service_utils/utils/redis_utils.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-03-20T13:09:14.000Z | 2022-03-20T13:09:14.000Z | # -*- coding: UTF-8 -*-
"""
Copyright 2020 Tianshu AI Platform. 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 req... | 28.402985 | 73 | 0.642669 |
40a1766d2be384af6baf24b4e9bb4c4eef17c745 | 5,498 | py | Python | Application/modules/treeHandling.py | Lincoln2000/Groot--Markdown_Note_Management_System | 518f971f2aa2ef0b52b4842545a13022f54d534e | [
"MIT"
] | 2 | 2021-02-13T15:36:40.000Z | 2021-03-20T06:27:36.000Z | Application/modules/treeHandling.py | sarvagyab/Groot | 518f971f2aa2ef0b52b4842545a13022f54d534e | [
"MIT"
] | 1 | 2020-06-07T07:39:11.000Z | 2020-06-10T11:53:42.000Z | Application/modules/treeHandling.py | sarvagyab/Groot | 518f971f2aa2ef0b52b4842545a13022f54d534e | [
"MIT"
] | 2 | 2021-12-22T09:55:51.000Z | 2022-01-05T02:11:34.000Z | import json
from PySide2 import QtWidgets, QtCore,QtGui
from Application.modules.fileHandling import currentNote
from Application.modules.noteHandling import loadNote
def getJsonTree():
location = "./Application/fileStructure.json"
structDict = ""
with open(location,"r",encoding='utf8') as jsonfile:
... | 35.934641 | 206 | 0.651146 |
e4196f58f69e5382298fc1fc5d2ceeabd7ca4afc | 333 | py | Python | Algo_practice/PermMissingElem.py | harsh52/Assignments-competitive_coding | bec05217ca3d67f71d5209498dc5e6bfae9d4a93 | [
"Apache-2.0"
] | 8 | 2018-09-28T19:15:50.000Z | 2020-02-22T11:17:24.000Z | Algo_practice/PermMissingElem.py | harsh52/Assignments-competitive_coding | bec05217ca3d67f71d5209498dc5e6bfae9d4a93 | [
"Apache-2.0"
] | null | null | null | Algo_practice/PermMissingElem.py | harsh52/Assignments-competitive_coding | bec05217ca3d67f71d5209498dc5e6bfae9d4a93 | [
"Apache-2.0"
] | 2 | 2019-09-14T21:33:52.000Z | 2020-02-13T11:06:08.000Z | def solution(A):
length = len(A)+1
actual_sum = (length)*(length+1)
actual_sum = actual_sum/2
#print(actual_sum)
array_sum = 0
for i in range(len(A)):
array_sum = array_sum + A[i]
#print(array_sum)
# result = actual_sum - array_sum
print(int(result))
A = [2,3,1,5]
... | 17.526316 | 36 | 0.582583 |
de8d146ccf4e0fe2d18908a302af36d16ac5483c | 1,447 | py | Python | ocr.py | robmarkcole/Number-Plate-Recognition | 5a7419be85a9605ad50c6099165740be14d198bb | [
"MIT"
] | 1 | 2021-05-26T14:35:41.000Z | 2021-05-26T14:35:41.000Z | ocr.py | robmarkcole/Number-Plate-Recognition | 5a7419be85a9605ad50c6099165740be14d198bb | [
"MIT"
] | null | null | null | ocr.py | robmarkcole/Number-Plate-Recognition | 5a7419be85a9605ad50c6099165740be14d198bb | [
"MIT"
] | null | null | null | # import the necessary packages
from PIL import Image
import pytesseract
import argparse
import cv2
import os
import numpy as np
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image to be OCR'd")
ap.add_argument(... | 27.301887 | 87 | 0.718037 |
ec9df27d25a5f8dcf9f6dc5ea689d9ec4df72472 | 2,161 | py | Python | get_population_data.py | m5matthew/COVID-19-Data-Collector | 63f83aee3d2a42950b2838a618f197af566c2938 | [
"ICU"
] | null | null | null | get_population_data.py | m5matthew/COVID-19-Data-Collector | 63f83aee3d2a42950b2838a618f197af566c2938 | [
"ICU"
] | null | null | null | get_population_data.py | m5matthew/COVID-19-Data-Collector | 63f83aee3d2a42950b2838a618f197af566c2938 | [
"ICU"
] | null | null | null | '''
Statistical Machine Learning Lab at UCLA
This script collects COVID-19 population data by state and by county.
Data Collected:
- 'Geographic Area Name'
- 'Total Population'
- 'Population per square meter (Population Density)'
- 'Population 65 Years and Over'
- 'Percent of Population that is 65 Years and Over'
- 'P... | 42.372549 | 152 | 0.764924 |
5f1301c1c19735d2b229c9c1ed07cda913fe1aaf | 1,323 | py | Python | demo/disease_report/run.py | reuben/gradio | f7e94b78f8760aba0090e87379e6820892fd27fd | [
"Apache-2.0"
] | 13 | 2019-02-19T08:32:57.000Z | 2019-05-23T03:43:19.000Z | demo/disease_report/run.py | cansik/gradio | 719d107d87abc472cb601f1374a25fbf25adf061 | [
"Apache-2.0"
] | 55 | 2021-10-01T03:00:28.000Z | 2021-12-28T03:23:04.000Z | demo/disease_report/run.py | cansik/gradio | 719d107d87abc472cb601f1374a25fbf25adf061 | [
"Apache-2.0"
] | 1 | 2021-12-29T10:54:14.000Z | 2021-12-29T10:54:14.000Z | import gradio as gr
import numpy as np
from fpdf import FPDF
import os
import tempfile
def disease_report(img, scan_for, generate_report):
results = []
for i, mode in enumerate(["Red", "Green", "Blue"]):
color_filter = np.array([0, 0, 0])
color_filter[i] = 1
results.append([mode, img * ... | 29.4 | 104 | 0.596372 |
4b5637bda65d13b90d1c7260330ba2bf759a5a54 | 4,023 | py | Python | receptor/service/main.py | vallemrv/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | 3 | 2017-07-16T09:31:56.000Z | 2019-03-20T11:11:24.000Z | receptor/service/main.py | ljimaz33/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | null | null | null | receptor/service/main.py | ljimaz33/tpvB3 | 9988a528b32692b01bd042cc6486188c4dc2109b | [
"Apache-2.0"
] | 1 | 2022-01-02T11:22:45.000Z | 2022-01-02T11:22:45.000Z | # -*- coding: utf-8 -*-
# @Author: Manuel Rodriguez <valle>
# @Date: 05-Mar-2018
# @Email: valle.mrv@gmail.com
# @Last modified by: valle
# @Last modified time: 07-Mar-2018
# @License: Apache license vesion 2.0
import sys
import os
reload(sys)
sys.setdefaultencoding('UTF8')
BASE_DIR = os.path.dirname(os.path.di... | 26.82 | 102 | 0.622173 |
444974b3d2e71f789283bb27b0f68670cb97e3cb | 364 | py | Python | Desafios/desafio022.py | ward910/Python-Aprendizado | b7af1d270a522fbac03f3f680d558c2552f2b60b | [
"MIT"
] | 2 | 2021-08-30T20:21:16.000Z | 2022-02-11T21:51:37.000Z | Desafios/desafio022.py | ward910/Python-Aprendizado | b7af1d270a522fbac03f3f680d558c2552f2b60b | [
"MIT"
] | null | null | null | Desafios/desafio022.py | ward910/Python-Aprendizado | b7af1d270a522fbac03f3f680d558c2552f2b60b | [
"MIT"
] | null | null | null | nome = str(input('Digite seu nome completo: ')).strip()
print('Analisando seu nome...')
print(f'Seu nome em maiúsculas é {nome.upper()}')
print(f'Seu nome em minúsculas é {nome.lower()}')
print(f'Seu nome tem o todo {len(nome) - nome.count(" ")}')
nomeSplit = nome.split()
print(f'Seu primero nome é {nomeSplit[0][0:]... | 36.4 | 88 | 0.67033 |
05585fa17dd4dcac69bfe661a80453b83352a481 | 4,072 | py | Python | tests/test_project.py | LouisStAmour/pdm | e05cd47d46cc492bbbf29d6eb932cf353ee82ea9 | [
"MIT"
] | null | null | null | tests/test_project.py | LouisStAmour/pdm | e05cd47d46cc492bbbf29d6eb932cf353ee82ea9 | [
"MIT"
] | null | null | null | tests/test_project.py | LouisStAmour/pdm | e05cd47d46cc492bbbf29d6eb932cf353ee82ea9 | [
"MIT"
] | null | null | null | import os
import sys
import venv
from pathlib import Path
import distlib.wheel
import pytest
from pdm.models.requirements import filter_requirements_with_extras
from pdm.pep517.api import build_wheel
from pdm.project import Project
from pdm.utils import cd, temp_environ
def test_project_python_with_pyenv_support(pr... | 31.8125 | 87 | 0.682957 |
b4de8f18cd6cc977c2b6f241c332011c2cb7b69f | 814 | py | Python | boxes/admin.py | sergeimellow/hawkpost | 66404c785ccf760310b5e6a5bfb8983c729bced8 | [
"MIT"
] | 930 | 2016-04-25T06:03:08.000Z | 2022-03-23T18:26:44.000Z | boxes/admin.py | webcrawler39/hawkpost | a6ab0d7864fe01a42756d82c082c5a2f1f8678a2 | [
"MIT"
] | 152 | 2016-04-02T15:49:07.000Z | 2021-07-07T10:41:27.000Z | boxes/admin.py | webcrawler39/hawkpost | a6ab0d7864fe01a42756d82c082c5a2f1f8678a2 | [
"MIT"
] | 62 | 2016-05-07T20:18:54.000Z | 2021-06-06T10:51:51.000Z | from django.contrib import admin
from .models import Box, Membership, Message
class MessageInline(admin.TabularInline):
model = Message
extra = 0
@admin.register(Box)
class BoxAdmin(admin.ModelAdmin):
list_display = ('name', 'owner', 'created_at', 'expires_at')
list_filter = ('status', 'created_at',... | 28.068966 | 64 | 0.695332 |
6845d6b204eb07e549d5c51c432c21afe343331c | 7,986 | py | Python | config/dictionary_parser.py | oa-sys/driver-mnt-canopen | 6e1677e370aa4081819866be614a23a3ce1e6cb1 | [
"MIT"
] | null | null | null | config/dictionary_parser.py | oa-sys/driver-mnt-canopen | 6e1677e370aa4081819866be614a23a3ce1e6cb1 | [
"MIT"
] | null | null | null | config/dictionary_parser.py | oa-sys/driver-mnt-canopen | 6e1677e370aa4081819866be614a23a3ce1e6cb1 | [
"MIT"
] | null | null | null | import csv
import sys
import os
import configargparse
MOUNT_TYPE = "driver/mnt/canopen/Mount"
META_TYPE = "driver/mnt/canopen/Meta"
ENTRY_TYPE = "driver/mnt/canopen/Entry"
argparse = configargparse.ArgParser()
argparse.add('-i', '--input', type=str, required=True,
help="Input - Dictionary config file. Example:\n-... | 31.07393 | 80 | 0.511019 |
c2ae2ee1d58c7e9e5a7d39b004d0fc9e07ad8f65 | 200 | py | Python | mjt/mjt/doctype/design_approval_strike_off/design_approval_strike_off.py | hamzaali15/mjt | 20ef7812d942644ade9c390d17075deacf1d2757 | [
"MIT"
] | null | null | null | mjt/mjt/doctype/design_approval_strike_off/design_approval_strike_off.py | hamzaali15/mjt | 20ef7812d942644ade9c390d17075deacf1d2757 | [
"MIT"
] | null | null | null | mjt/mjt/doctype/design_approval_strike_off/design_approval_strike_off.py | hamzaali15/mjt | 20ef7812d942644ade9c390d17075deacf1d2757 | [
"MIT"
] | 1 | 2021-08-11T08:15:01.000Z | 2021-08-11T08:15:01.000Z | # Copyright (c) 2021, RF and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class DesignApprovalStrikeOff(Document):
pass
| 22.222222 | 49 | 0.8 |
4bb23125b1b4c604c98de5908c536a9a64a6c965 | 4,668 | py | Python | agent/kubeinit/cli.py | Ansible-Project/kubeinit | f21b006ae90a75a11661c3d70386a02317afa4fa | [
"Apache-2.0"
] | 36 | 2020-08-01T07:31:15.000Z | 2020-09-04T05:39:32.000Z | agent/kubeinit/cli.py | Ansible-Project/kubeinit | f21b006ae90a75a11661c3d70386a02317afa4fa | [
"Apache-2.0"
] | 9 | 2020-08-03T17:07:29.000Z | 2020-08-28T14:26:53.000Z | agent/kubeinit/cli.py | Ansible-Project/kubeinit | f21b006ae90a75a11661c3d70386a02317afa4fa | [
"Apache-2.0"
] | 14 | 2020-08-02T01:07:37.000Z | 2020-08-25T13:14:02.000Z | #!/usr/bin/env python
"""
Copyright kubeinit contributors.
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.com/licenses/LICENSE-2.0
Unless required by applicable law or agreed ... | 31.540541 | 85 | 0.562125 |
504e29cab4f563f34379c0476404d434f1b04efa | 3,055 | py | Python | NiaPy/algorithms/basic/pso.py | kivancguckiran/NiaPy | 06d3699c1466bfc54c4220a4aabe97cad50f75e4 | [
"MIT"
] | 2 | 2018-10-07T08:41:44.000Z | 2019-04-05T15:30:56.000Z | NiaPy/algorithms/basic/pso.py | kivancguckiran/NiaPy | 06d3699c1466bfc54c4220a4aabe97cad50f75e4 | [
"MIT"
] | null | null | null | NiaPy/algorithms/basic/pso.py | kivancguckiran/NiaPy | 06d3699c1466bfc54c4220a4aabe97cad50f75e4 | [
"MIT"
] | null | null | null | # encoding=utf8
# pylint: disable=mixed-indentation, line-too-long, singleton-comparison, multiple-statements, attribute-defined-outside-init, no-self-use, logging-not-lazy, unused-variable, arguments-differ, bad-continuation
import logging
from numpy import apply_along_axis, argmin, full, inf, where
from NiaPy.algorit... | 35.523256 | 209 | 0.679542 |
cac0e5064df03870bb5131c7d3b7dfbfdfeb743d | 8,966 | py | Python | sdk/python/pulumi_azure_nextgen/documentdb/v20150401/get_database_account_sql_container.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/documentdb/v20150401/get_database_account_sql_container.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/documentdb/v20150401/get_database_account_sql_container.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 41.702326 | 505 | 0.665737 |
74be8add34d36266b18bf504624477afb94a0ee4 | 84 | py | Python | room/admin.py | pycoder2000/djangochat | b242f42e65c633d31d395e22d908101188ec8848 | [
"MIT"
] | null | null | null | room/admin.py | pycoder2000/djangochat | b242f42e65c633d31d395e22d908101188ec8848 | [
"MIT"
] | null | null | null | room/admin.py | pycoder2000/djangochat | b242f42e65c633d31d395e22d908101188ec8848 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Room
admin.site.register(Room) | 21 | 32 | 0.821429 |
b8268f9f6087cd57fdd127a208f433479bb767b0 | 7,085 | py | Python | GUI/DirsHandlerGUI.py | avpreserve/interstitial | 4ac1fa470670289350fe32227400b325a1f2a328 | [
"BSD-3-Clause"
] | 5 | 2015-11-06T18:00:11.000Z | 2017-12-14T16:22:33.000Z | GUI/DirsHandlerGUI.py | avpreserve/interstitial | 4ac1fa470670289350fe32227400b325a1f2a328 | [
"BSD-3-Clause"
] | 1 | 2021-02-09T18:03:10.000Z | 2021-02-09T18:03:10.000Z | GUI/DirsHandlerGUI.py | WeAreAVP/interstitial | 4ac1fa470670289350fe32227400b325a1f2a328 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# Interstitial Error Detector
# Version 0.2, 2013-08-28
# Copyright (c) 2013 AudioVisual Preservation Solutions
# All rights reserved.
# Released under the Apache license, v. 2.0
# Created on May 14, 2014
# @author: Furqan Wasi <furqan@avpreserve.com>
from PySide.QtCore import *
from ... | 34.901478 | 117 | 0.664644 |
0162afec28247b42ae8afe972002029262607ae2 | 2,249 | py | Python | scripts/plot_tank_multipanel_wspd.py | sustain-lab/umwm-sustain | 5988a5523ea00f99902341834c8115473e0bf4a3 | [
"MIT"
] | 1 | 2018-10-09T22:18:39.000Z | 2018-10-09T22:18:39.000Z | scripts/plot_tank_multipanel_wspd.py | sustain-lab/umwm-sustain | 5988a5523ea00f99902341834c8115473e0bf4a3 | [
"MIT"
] | null | null | null | scripts/plot_tank_multipanel_wspd.py | sustain-lab/umwm-sustain | 5988a5523ea00f99902341834c8115473e0bf4a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
import f90nml
from netCDF4 import Dataset
import os
import shutil
import subprocess
# path to store finished experiments
path = '/home/milan/Work/sustain/umwm-sustain/experiments/ta... | 27.426829 | 81 | 0.60827 |
6191fb9c5b944a3e80af31f1b7a6da84c05f429e | 22,878 | py | Python | Main/data.py | XIAO-LI-UPF/Natural-Language-ParagraphGeneration | 7d13e087bd2baa9a7f393fcc63e84e6aee1a3e34 | [
"MIT"
] | null | null | null | Main/data.py | XIAO-LI-UPF/Natural-Language-ParagraphGeneration | 7d13e087bd2baa9a7f393fcc63e84e6aee1a3e34 | [
"MIT"
] | null | null | null | Main/data.py | XIAO-LI-UPF/Natural-Language-ParagraphGeneration | 7d13e087bd2baa9a7f393fcc63e84e6aee1a3e34 | [
"MIT"
] | null | null | null | from collections import defaultdict
from itertools import repeat, cycle
import random
import re
import lzma
import Levenshtein
from random import choice
# import sys
# sys.setrecursionlimit(100000)
# export PYTHONWARNINGS='ignore:semaphore_tracker:UserWarning'
class Token(dict):
def __init__(self, entries):
... | 39.309278 | 137 | 0.469228 |
8d671307a46dba72bc3ad830009559600cd132eb | 6,013 | py | Python | app/main.py | tmastrom/BattleSnake19 | aacfceb2c6aa6f26fc80c8e5b9af8aee5bc0352f | [
"MIT"
] | null | null | null | app/main.py | tmastrom/BattleSnake19 | aacfceb2c6aa6f26fc80c8e5b9af8aee5bc0352f | [
"MIT"
] | null | null | null | app/main.py | tmastrom/BattleSnake19 | aacfceb2c6aa6f26fc80c8e5b9af8aee5bc0352f | [
"MIT"
] | null | null | null | import json
import os
import random
import bottle
from api import ping_response, start_response, move_response, end_response
@bottle.route('/')
def index():
return '''
Battlesnake documentation can be found at
<a href="https://docs.battlesnake.io">https://docs.battlesnake.io</a>.
'''
@bottle.route... | 26.84375 | 100 | 0.582571 |
86b1baa33791fa26ec611840e56520cbbf6a1137 | 12,370 | py | Python | pyiron_atomistics/vasp/volumetric_data.py | dgehringer/pyiron_atomistics | f8f2d573a483e802c8e5840998a0769378b95e31 | [
"BSD-3-Clause"
] | null | null | null | pyiron_atomistics/vasp/volumetric_data.py | dgehringer/pyiron_atomistics | f8f2d573a483e802c8e5840998a0769378b95e31 | [
"BSD-3-Clause"
] | 1 | 2022-02-24T09:51:10.000Z | 2022-02-24T09:51:10.000Z | pyiron_atomistics/vasp/volumetric_data.py | srmnitc/pyiron_atomistics | 2c8052b082f2c4fb6f6291ac2b1f801ea7ab1567 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import math
import numpy as np
import os
from pyiron_base import state
from pyiron_atomistics.vasp.structure import (
... | 39.77492 | 119 | 0.532336 |
c2e84b89796ffd6139730bcc6668d03b5a7682e2 | 5,282 | py | Python | code/example_code/google_class.py | ianpcook/info_transmission | f0533f7643f5d29fc31932d9f59fd46cbc1a333b | [
"CC0-1.0"
] | null | null | null | code/example_code/google_class.py | ianpcook/info_transmission | f0533f7643f5d29fc31932d9f59fd46cbc1a333b | [
"CC0-1.0"
] | null | null | null | code/example_code/google_class.py | ianpcook/info_transmission | f0533f7643f5d29fc31932d9f59fd46cbc1a333b | [
"CC0-1.0"
] | null | null | null | # Python Intro Class
# Google
# March 19, 2014
import os, re, random, string, sys
words = set(open('/Applications/sage/local/include/python2.7/pyconfig.h').read().split())
words = [word for word in words if re.match("^[a-z]+$", word)]
def field():
if random.randint(1,20) < 19:
return words[random.randint(0, len(... | 31.819277 | 89 | 0.727187 |
e7098c2d85c6407edaa819e3b5f3b5c26b62de53 | 617 | py | Python | var/spack/repos/builtin/packages/py-itsdangerous/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-itsdangerous/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-itsdangerous/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 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 PyItsdangerous(PythonPackage):
"""Various helpers to pass trusted data to untrusted enviro... | 34.277778 | 94 | 0.76013 |
c1824f9e5f09c9a5e6a2634b8077f4881557e7ef | 15,544 | py | Python | torchsupport/structured/structures/connection.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 18 | 2019-05-02T16:32:15.000Z | 2021-04-16T09:33:54.000Z | torchsupport/structured/structures/connection.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 5 | 2019-10-14T13:46:49.000Z | 2021-06-08T11:48:34.000Z | torchsupport/structured/structures/connection.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 12 | 2019-05-12T21:34:24.000Z | 2021-07-15T14:14:16.000Z | from enum import Enum
from copy import copy, deepcopy
import torch
import networkx as nx
from torchsupport.data.collate import Collatable
from torchsupport.data.io import DeviceMovable
from torchsupport.structured.chunkable import (
Chunkable, chunk_sizes, chunk_tensor
)
class MessageMode(Enum):
iterative = 0
... | 30.658777 | 89 | 0.679619 |
66483ba6049d74334d153503e765eef01073cba0 | 3,698 | py | Python | RegressionCNN/regression_data_segmentation_generator.py | vladiant/ObjectDetectSamples | ac82d0d8284f6fdbcebf1ff429d2aec18cf03fb0 | [
"MIT"
] | null | null | null | RegressionCNN/regression_data_segmentation_generator.py | vladiant/ObjectDetectSamples | ac82d0d8284f6fdbcebf1ff429d2aec18cf03fb0 | [
"MIT"
] | null | null | null | RegressionCNN/regression_data_segmentation_generator.py | vladiant/ObjectDetectSamples | ac82d0d8284f6fdbcebf1ff429d2aec18cf03fb0 | [
"MIT"
] | null | null | null | # https://towardsdatascience.com/step-by-step-r-cnn-implementation-from-scratch-in-python-e97101ccde55
# https://github.com/1297rohit/RCNN
import os
import cv2
import pandas as pd
import numpy as np
# Intersection over Union https://www.pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/... | 30.816667 | 116 | 0.53867 |
44c309465ec11e80be2d1a2254f1a691348b910b | 2,176 | py | Python | examples/bamboo/bamboo-remove-unknown-status-build-results.py | monester/atlassian-python-api | 8d543c024d41dcae1cd215868fa690be0ce5d95c | [
"Apache-2.0"
] | 1 | 2020-03-03T20:09:07.000Z | 2020-03-03T20:09:07.000Z | examples/bamboo/bamboo-remove-unknown-status-build-results.py | monester/atlassian-python-api | 8d543c024d41dcae1cd215868fa690be0ce5d95c | [
"Apache-2.0"
] | null | null | null | examples/bamboo/bamboo-remove-unknown-status-build-results.py | monester/atlassian-python-api | 8d543c024d41dcae1cd215868fa690be0ce5d95c | [
"Apache-2.0"
] | 1 | 2021-05-07T10:00:07.000Z | 2021-05-07T10:00:07.000Z | from atlassian import Bamboo
import logging
"""
That example shows how to clean up Bamboo incomplete or Unknown build results
"""
logging.basicConfig(level=logging.ERROR)
REMOVE = True
STATUS_CLEANED_RESULTS = ['Incomplete', 'Unknown']
EXCLUDED_PROJECTS = ["EXCLUDE_PROJECT"]
BAMBOO_LOGIN = "admin"
BAMBOO_PASS = "pas... | 31.085714 | 115 | 0.682445 |
66fea3fae02271ca32221e099d3f099d25158c2a | 726 | py | Python | e07_encrypt_file_and_sign_it/nemexis_cipher.py | AndreiHondrari/security_exploration | 7d7cc539c0b68eff985d8830726c73b05a906a7c | [
"MIT"
] | null | null | null | e07_encrypt_file_and_sign_it/nemexis_cipher.py | AndreiHondrari/security_exploration | 7d7cc539c0b68eff985d8830726c73b05a906a7c | [
"MIT"
] | null | null | null | e07_encrypt_file_and_sign_it/nemexis_cipher.py | AndreiHondrari/security_exploration | 7d7cc539c0b68eff985d8830726c73b05a906a7c | [
"MIT"
] | null | null | null | """
An XOR symmetric stream cipher
"""
BLOCK_SIZE = 128
HEADER = "--- NEMEXIS ENCRYPTION ---\r\n".encode()
END_HEADER = "\r\n--- END_HEADER ---\r\n".encode()
SIGNATURE = "\r\n--- SIGNATURE ---\r\n".encode()
END = "\r\n--- END ---\r\n".encode()
def encrypt(original: bytes, shared_key: int) -> bytes:
if len(origi... | 20.742857 | 56 | 0.57438 |
4d22267ffde11d1b8e6652ea7f3c1ab1f91ae3b9 | 17,277 | py | Python | bluetooth.py | idaband/lionchief-controller-raspberrypi | bd2bbf58e5b44627d63ce87df7771610d7e2f675 | [
"MIT"
] | 1 | 2022-02-07T04:05:56.000Z | 2022-02-07T04:05:56.000Z | bluetooth.py | idaband/lionchief-controller-raspberrypi | bd2bbf58e5b44627d63ce87df7771610d7e2f675 | [
"MIT"
] | null | null | null | bluetooth.py | idaband/lionchief-controller-raspberrypi | bd2bbf58e5b44627d63ce87df7771610d7e2f675 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
bluetooth.py
============
Python wrapper for gatttool, to allow programmatic control of Bluetooth LE
devices from within Python.
Much of the gatttool interface is borrowed from the gatttool backend of
https://github.com/stratosinc/pygatt, which is distributed under an Apache
2.0 license: ht... | 37.640523 | 80 | 0.595705 |
c3fa3596fe8ab5019e9ff9e6eccb6c8551fb6531 | 1,454 | py | Python | configuration/setdatetime.py | hacktobeer/BirdCam | 864411a6822b5cbf58acecbc699f8fbe15e0a7a5 | [
"Apache-2.0"
] | null | null | null | configuration/setdatetime.py | hacktobeer/BirdCam | 864411a6822b5cbf58acecbc699f8fbe15e0a7a5 | [
"Apache-2.0"
] | null | null | null | configuration/setdatetime.py | hacktobeer/BirdCam | 864411a6822b5cbf58acecbc699f8fbe15e0a7a5 | [
"Apache-2.0"
] | 1 | 2020-05-30T07:18:52.000Z | 2020-05-30T07:18:52.000Z | import datetime
from onvif import ONVIFCamera
TZ = "CET+1CEST"
mycam = ONVIFCamera('192.168.86.219', 8899, 'admin', 'admin', '/home/pi/wsdl/')
# Get system date and time
date_now = datetime.datetime.utcnow()
dt = mycam.devicemgmt.GetSystemDateAndTime()
tz = dt.TimeZone
year = str(dt.UTCDateTime.Date.Year)
month = str... | 38.263158 | 79 | 0.762036 |
edd105f76d0036ecfadf55336020effb2fe3b50d | 4,441 | py | Python | example/example/settings.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | 7 | 2018-01-12T04:31:42.000Z | 2021-12-17T15:27:51.000Z | example/example/settings.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | null | null | null | example/example/settings.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | 1 | 2022-03-18T08:19:10.000Z | 2022-03-18T08:19:10.000Z | """
Django settings for example project.
Generated by 'django-admin startproject' using Django 1.11.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... | 24.401099 | 91 | 0.700293 |
22cb413a88aac432025994b057f0a8b9d3a6f361 | 1,398 | py | Python | Hackerrank/Apple and Orange/Apple and Orange.py | arushmangal/Hack-CP-DSA | 91f5aabc4741c1c518f35065273c7fcfced67061 | [
"MIT"
] | 205 | 2021-09-30T15:41:05.000Z | 2022-03-27T18:34:56.000Z | Hackerrank/Apple and Orange/Apple and Orange.py | arushmangal/Hack-CP-DSA | 91f5aabc4741c1c518f35065273c7fcfced67061 | [
"MIT"
] | 566 | 2021-09-30T15:27:27.000Z | 2021-10-16T21:21:02.000Z | Hackerrank/Apple and Orange/Apple and Orange.py | arushmangal/Hack-CP-DSA | 91f5aabc4741c1c518f35065273c7fcfced67061 | [
"MIT"
] | 399 | 2021-09-29T05:40:46.000Z | 2022-03-27T18:34:58.000Z | #!/bin/python3
import math
import os
import random
import re
import sys
# The function accepts following parameters:
# 1. INTEGER s = start point
# 2. INTEGER t = End point
# 3. INTEGER a = location of apple tree
# 4. INTEGER b = location of orange tree
# 5. INTEGER_ARRAY apples
# 6. INTEGER_ARRAY oranges
def ... | 25.418182 | 99 | 0.656652 |
3cafd32cd528becce6a12283f1dbfd445db3d0d1 | 7,929 | py | Python | pygments/lexers/grammar_notation.py | KMilhan/pygments | 5120e9943d137f7aa1d33499b79d5ebd5c9f775d | [
"BSD-2-Clause"
] | 1,198 | 2015-01-02T12:08:49.000Z | 2021-10-07T02:46:59.000Z | pygments/lexers/grammar_notation.py | KMilhan/pygments | 5120e9943d137f7aa1d33499b79d5ebd5c9f775d | [
"BSD-2-Clause"
] | 249 | 2015-01-22T13:31:12.000Z | 2021-05-01T08:01:22.000Z | pygments/lexers/grammar_notation.py | KMilhan/pygments | 5120e9943d137f7aa1d33499b79d5ebd5c9f775d | [
"BSD-2-Clause"
] | 118 | 2015-01-16T19:13:15.000Z | 2021-07-21T15:09:15.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.grammar_notation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for grammer notations like BNF.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, byg... | 29.258303 | 80 | 0.46538 |
9b24b59c9f0d39b1f3fb9329889cca9aee8718ec | 14,740 | py | Python | recbole/model/knowledge_aware_recommender/ripplenet.py | xingkongxiaxia/xx | a75e3894adfd05f5167ca76c48d1bf8626ee8588 | [
"MIT"
] | 4 | 2021-04-23T07:47:53.000Z | 2022-02-01T13:48:33.000Z | recbole/model/knowledge_aware_recommender/ripplenet.py | xingkongxiaxia/RecBole | ce51d75406592d6bc25bb803f773f0788496fd97 | [
"MIT"
] | null | null | null | recbole/model/knowledge_aware_recommender/ripplenet.py | xingkongxiaxia/RecBole | ce51d75406592d6bc25bb803f773f0788496fd97 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/9/28
# @Author : gaole he
# @Email : hegaole@ruc.edu.cn
r"""
RippleNet
#####################################################
Reference:
Hongwei Wang et al. "RippleNet: Propagating User Preferences on the Knowledge Graph for Recommender Systems."
in CIKM 2018.
"""
imp... | 41.756374 | 128 | 0.582225 |
127836a6c67181e5537247025cc79962151fc7ce | 7,670 | py | Python | test/functional/feature_assumevalid.py | patentcoin/patentcoin | 5dd4ba6cf18946be6be0f564952a55358c81fe95 | [
"MIT"
] | 1 | 2021-12-11T19:14:32.000Z | 2021-12-11T19:14:32.000Z | test/functional/feature_assumevalid.py | Cryptogits/patentcoin | 5dd4ba6cf18946be6be0f564952a55358c81fe95 | [
"MIT"
] | null | null | null | test/functional/feature_assumevalid.py | Cryptogits/patentcoin | 5dd4ba6cf18946be6be0f564952a55358c81fe95 | [
"MIT"
] | 2 | 2020-06-27T10:26:01.000Z | 2021-12-11T15:33:50.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test logic for skipping signature validation on old blocks.
Test logic for skipping signature validati... | 39.132653 | 107 | 0.654889 |
43bf523b0ef94409b0260a284fcd89601918fc2a | 449 | py | Python | fdk_client/platform/models/CancelSubscriptionReq.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/CancelSubscriptionReq.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/CancelSubscriptionReq.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class CancelSubscriptionReq(BaseSchema):
# Billing swagger.json
unique_id = fields.Str(required=False)
type = fields.Str... | 14.966667 | 48 | 0.701559 |
fa1e8ed800831aeddeb3638bc7c18083bd8b504d | 24,736 | py | Python | readthedocs/projects/forms.py | Toder34hey/readthedocs.org | c85171ae62a5e4d97e044d0d39f68ef677854f39 | [
"MIT"
] | 1 | 2020-10-22T14:25:13.000Z | 2020-10-22T14:25:13.000Z | readthedocs/projects/forms.py | Toder34hey/readthedocs.org | c85171ae62a5e4d97e044d0d39f68ef677854f39 | [
"MIT"
] | null | null | null | readthedocs/projects/forms.py | Toder34hey/readthedocs.org | c85171ae62a5e4d97e044d0d39f68ef677854f39 | [
"MIT"
] | null | null | null | """Project forms."""
from random import choice
from re import fullmatch
from urllib.parse import urlparse
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Fieldset, Layout, HTML, Submit
from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from ... | 31.43075 | 107 | 0.598763 |
e991f090c52aa8f270df7a36f4b4827c0c65c315 | 1,495 | py | Python | cloudera-parcel/patch.py | danielfrg/dist | 4f5658be4965085693fa905bc453116b7306b02f | [
"Apache-2.0"
] | 1 | 2019-02-05T01:35:15.000Z | 2019-02-05T01:35:15.000Z | cloudera-parcel/patch.py | danielfrg/dist | 4f5658be4965085693fa905bc453116b7306b02f | [
"Apache-2.0"
] | null | null | null | cloudera-parcel/patch.py | danielfrg/dist | 4f5658be4965085693fa905bc453116b7306b02f | [
"Apache-2.0"
] | null | null | null | import os
import re
from optparse import OptionParser
def fix_binaries(prefix):
"""
Fix the binaries under the prefix
"""
bin_dir = os.path.join(prefix, "bin")
for fname in os.listdir(bin_dir):
filepath = os.path.join(bin_dir, fname)
if not is_elf(filepath):
fix_shebang... | 26.22807 | 78 | 0.611371 |
1f645e1484c47b3f79f08b343906c12e17a3a9a8 | 297 | py | Python | src/compas/geometry/bbox/__init__.py | kathrindoerfler/compas | e876b36b582ee055da673befca1b7ced3834090c | [
"MIT"
] | null | null | null | src/compas/geometry/bbox/__init__.py | kathrindoerfler/compas | e876b36b582ee055da673befca1b7ced3834090c | [
"MIT"
] | 9 | 2019-09-11T08:53:19.000Z | 2019-09-16T08:35:39.000Z | src/compas/geometry/bbox/__init__.py | Licini/compas | 34f65adb3d0abc3f403312ffba62aa76f3376292 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import compas
from .bbox import * # noqa: F401 F403
if not compas.IPY:
from .bbox_numpy import * # noqa: F401 F403
__all__ = [name for name in dir() if not name.startswith('_')]
| 22.846154 | 62 | 0.754209 |
ade0186b856207a3237afcc9a811d02a5ba3b61e | 1,995 | py | Python | bot/injectors.py | Alpha-Omega-United/discord-bot | d395c1e139de8b59773fb0a222d08f68105a811c | [
"MIT"
] | 1 | 2021-09-21T07:50:39.000Z | 2021-09-21T07:50:39.000Z | bot/injectors.py | Alpha-Omega-United/discord-bot | d395c1e139de8b59773fb0a222d08f68105a811c | [
"MIT"
] | 1 | 2021-07-30T20:31:49.000Z | 2021-08-17T16:50:43.000Z | bot/injectors.py | Alpha-Omega-United/discord-bot | d395c1e139de8b59773fb0a222d08f68105a811c | [
"MIT"
] | 1 | 2021-08-10T16:41:39.000Z | 2021-08-10T16:41:39.000Z | """Type depedecies for the bot."""
from __future__ import annotations
from typing import TYPE_CHECKING, TypeVar
import aiohttp
import tanjun
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from motor import motor_asyncio as motor
from bot import constants, types
if TYPE_CHECKING:
from typing import... | 25.576923 | 77 | 0.700251 |
de82fac6e727b2ff594c15facee8f9bc5c86e7aa | 15,432 | py | Python | python/archrpi4-install.py | victor7w7r/036raspberry | c09ed8ef834bb56425355d871070bddf244b5864 | [
"MIT"
] | 1 | 2021-12-15T18:28:05.000Z | 2021-12-15T18:28:05.000Z | python/archrpi4-install.py | victor7w7r/036raspberry | c09ed8ef834bb56425355d871070bddf244b5864 | [
"MIT"
] | null | null | null | python/archrpi4-install.py | victor7w7r/036raspberry | c09ed8ef834bb56425355d871070bddf244b5864 | [
"MIT"
] | null | null | null | from subprocess import call, PIPE, Popen
from sys import stdin, stdout, platform, version_info
from os import system, getuid
from urllib.request import urlopen
from termios import tcgetattr, tcsetattr, TCSADRAIN
from time import sleep
from tty import setcbreak
from dialog import Dialog
d = Dialog(dialog="dialog")
d.se... | 52.849315 | 155 | 0.484059 |
4636d6dbeccaa0d6d6e76994413f7d6c98a230b6 | 4,710 | py | Python | ceilometer/storage/impl_log.py | CiscoSystems/ceilometer | a9267fd94e7854afa0720d761fbe75d946e7167d | [
"Apache-2.0"
] | 1 | 2021-11-22T11:00:53.000Z | 2021-11-22T11:00:53.000Z | ceilometer/storage/impl_log.py | CiscoSystems/ceilometer | a9267fd94e7854afa0720d761fbe75d946e7167d | [
"Apache-2.0"
] | null | null | null | ceilometer/storage/impl_log.py | CiscoSystems/ceilometer | a9267fd94e7854afa0720d761fbe75d946e7167d | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
#
# 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
#
# ... | 32.040816 | 78 | 0.62569 |
b97968f66622c0874105dde05b1e63cfe2507d4a | 5,430 | py | Python | python/ray/experimental/data/deltacat/compute/compactor/steps/materialize.py | goswamig/amazon-ray | 9984ebcdc9d0da0de65363074021e9aff2f82636 | [
"Apache-2.0"
] | null | null | null | python/ray/experimental/data/deltacat/compute/compactor/steps/materialize.py | goswamig/amazon-ray | 9984ebcdc9d0da0de65363074021e9aff2f82636 | [
"Apache-2.0"
] | null | null | null | python/ray/experimental/data/deltacat/compute/compactor/steps/materialize.py | goswamig/amazon-ray | 9984ebcdc9d0da0de65363074021e9aff2f82636 | [
"Apache-2.0"
] | null | null | null | import logging
import ray
import pyarrow as pa
import pyarrow.compute as pc
from collections import defaultdict
from itertools import chain, repeat
from ray.experimental.data.deltacat import logs
from ray.experimental.data.deltacat.aws.redshift.model import manifest as rsm, manifest_meta as rsmm
from ray.experimental.d... | 41.769231 | 100 | 0.710866 |
b5f67e713b9bd5326b1c87bf196b0d2e2c99052f | 12,715 | py | Python | sphinx/ext/imgmath.py | sephalon/sphinx | c892fe98f7a311dc51340f8d98e63d9790b7f820 | [
"BSD-2-Clause"
] | null | null | null | sphinx/ext/imgmath.py | sephalon/sphinx | c892fe98f7a311dc51340f8d98e63d9790b7f820 | [
"BSD-2-Clause"
] | null | null | null | sphinx/ext/imgmath.py | sephalon/sphinx | c892fe98f7a311dc51340f8d98e63d9790b7f820 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinx.ext.imgmath
~~~~~~~~~~~~~~~~~~
Render math in HTML via dvipng or dvisvgm.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import codecs
import shutil
import tempfile
import posixpath
from os ... | 34.088472 | 88 | 0.650334 |
909fa0cfb6b4d3620f0c9d286e37af4941de8273 | 3,712 | py | Python | DefensiveProgramming_3.py | ohallid/end_of_day_two | 37e4eace7e00d0c3743851cecaa838c073d324a7 | [
"MIT"
] | null | null | null | DefensiveProgramming_3.py | ohallid/end_of_day_two | 37e4eace7e00d0c3743851cecaa838c073d324a7 | [
"MIT"
] | null | null | null | DefensiveProgramming_3.py | ohallid/end_of_day_two | 37e4eace7e00d0c3743851cecaa838c073d324a7 | [
"MIT"
] | null | null | null |
# coding: utf-8
# # Defensive programming (2)
# We have seen the basic idea that we can insert
# assert statments into code, to check that the
# results are what we expect, but how can we test
# software more fully? Can doing this help us
# avoid bugs in the first place?
#
# One possible ap... | 32.561404 | 88 | 0.62931 |
0a81ff3733f82e192f09c4c20b9dc7fba01db19f | 3,150 | py | Python | pyScript/custom_src/Log.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/Log.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/Log.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QWidget, QScrollArea, QHBoxLayout, QVBoxLayout, QGridLayout, QPushButton, QPlainTextEdit, QLabel, QLayout
from PySide2.QtCore import Qt, QSize
from PySide2.QtGui import QFont
class Logger(QWidget):
def __init__(self, script):
super(Logger, self).__init__()
# UI
... | 27.631579 | 135 | 0.619048 |
9a4082f125b77643ee13fb85b62041baf1733fd4 | 2,097 | py | Python | profiles_api/models.py | banukk3/profiles-rest-api | e83f757ca4026e68753a54267a88ed45ef500373 | [
"MIT"
] | null | null | null | profiles_api/models.py | banukk3/profiles-rest-api | e83f757ca4026e68753a54267a88ed45ef500373 | [
"MIT"
] | 8 | 2019-12-05T01:05:59.000Z | 2022-02-10T09:05:40.000Z | profiles_api/models.py | banukk3/profiles-rest-api | e83f757ca4026e68753a54267a88ed45ef500373 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def cr... | 29.535211 | 64 | 0.68145 |
8146262bceca090ee317c01f95c8e515820cb6ab | 15,565 | py | Python | dvc/repo/experiments/executor/base.py | koelemay/dvc | b9b8c46fde7cdf7d9544dd83705d95beb601792a | [
"Apache-2.0"
] | null | null | null | dvc/repo/experiments/executor/base.py | koelemay/dvc | b9b8c46fde7cdf7d9544dd83705d95beb601792a | [
"Apache-2.0"
] | 81 | 2021-04-13T08:02:09.000Z | 2022-03-30T16:10:17.000Z | dvc/repo/experiments/executor/base.py | koelemay/dvc | b9b8c46fde7cdf7d9544dd83705d95beb601792a | [
"Apache-2.0"
] | null | null | null | import logging
import os
import pickle
from abc import ABC, abstractmethod
from contextlib import contextmanager
from functools import partial
from typing import (
TYPE_CHECKING,
Callable,
Iterable,
NamedTuple,
Optional,
Union,
)
from funcy import cached_property
from dvc.exceptions import Dvc... | 32.768421 | 79 | 0.570125 |
44fc1305ee72aeb5eb52a3a52ac51e53f1eba50a | 7,395 | py | Python | transformers/examples/seq2seq/test_bash_script.py | jordiclive/ControlPrefixes | b647f68bf0c7e771f847c4a51e5f22af2ac95699 | [
"Apache-1.1"
] | 26 | 2021-11-23T09:01:32.000Z | 2022-03-25T11:34:15.000Z | transformers/examples/seq2seq/test_bash_script.py | jordiclive/ControlPrefixes | b647f68bf0c7e771f847c4a51e5f22af2ac95699 | [
"Apache-1.1"
] | 3 | 2021-12-10T17:43:23.000Z | 2022-03-18T11:37:19.000Z | transformers/examples/seq2seq/test_bash_script.py | jordiclive/ControlPrefixes | b647f68bf0c7e771f847c4a51e5f22af2ac95699 | [
"Apache-1.1"
] | 5 | 2021-12-19T03:22:08.000Z | 2022-02-14T04:41:04.000Z | #!/usr/bin/env python
import argparse
import os
import sys
import tempfile
from pathlib import Path
from unittest.mock import patch
import pytest
import pytorch_lightning as pl
import timeout_decorator
import torch
from distillation import BartSummarizationDistiller, distill_main
from finetune import SummarizationMo... | 39.335106 | 131 | 0.679919 |
77f0b990e5793421cc4f5c4194c34e1ed7a0c868 | 932 | py | Python | python-ci-gitlab/cathay/sample/core.py | BruceLi1984/CUBtest | c5e0f4471474dec0830cc260d48858ad538477ba | [
"MIT"
] | null | null | null | python-ci-gitlab/cathay/sample/core.py | BruceLi1984/CUBtest | c5e0f4471474dec0830cc260d48858ad538477ba | [
"MIT"
] | null | null | null | python-ci-gitlab/cathay/sample/core.py | BruceLi1984/CUBtest | c5e0f4471474dec0830cc260d48858ad538477ba | [
"MIT"
] | null | null | null | from cathay.sample.customer import Customer
from decimal import Decimal
class CustomerDataProcess():
"""
Simulate some actions that banks will perform
...
Attributes
----------
None
Methods
-------
add_interest(customer, rate)
add interest to customer's balance
"""
... | 22.731707 | 74 | 0.574034 |
81f6d741d8326c286834130edc37cf3a14234259 | 5,982 | py | Python | experiments/experiment_DynaQNN_Aug11_base.py | huangxf14/deepnap | b4627ce1b9022d4f946d9b98d8d1622965cb7968 | [
"BSD-3-Clause"
] | null | null | null | experiments/experiment_DynaQNN_Aug11_base.py | huangxf14/deepnap | b4627ce1b9022d4f946d9b98d8d1622965cb7968 | [
"BSD-3-Clause"
] | null | null | null | experiments/experiment_DynaQNN_Aug11_base.py | huangxf14/deepnap | b4627ce1b9022d4f946d9b98d8d1622965cb7968 | [
"BSD-3-Clause"
] | null | null | null | # System built-in modules
import time
from datetime import datetime
import sys
import os
from multiprocessing import Pool
# Project dependency modules
import pandas as pd
pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment
import lasagne
# Project modules
sys.path.append('... | 34.578035 | 103 | 0.687897 |
f3cf3e1d244f0eb35c82119cbaf489e9113a79ea | 1,792 | py | Python | test/test_offers_api.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | test/test_offers_api.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | test/test_offers_api.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | """
MSX SDK
MSX SDK client. # noqa: E501
The version of the OpenAPI document: 1.0.9
Generated by: https://openapi-generator.tech
"""
import unittest
import python_msx_sdk
from python_msx_sdk.api.offers_api import OffersApi # noqa: E501
class TestOffersApi(unittest.TestCase):
"""OffersApi un... | 21.082353 | 79 | 0.604911 |
d5a3ee1a42f9580b3cd30a192542691ee6862453 | 22,046 | py | Python | kedro/io/partitioned_data_set.py | moutai/kedro | ebcd659f02948e79e7a7930026ca23776028014c | [
"Apache-2.0"
] | null | null | null | kedro/io/partitioned_data_set.py | moutai/kedro | ebcd659f02948e79e7a7930026ca23776028014c | [
"Apache-2.0"
] | null | null | null | kedro/io/partitioned_data_set.py | moutai/kedro | ebcd659f02948e79e7a7930026ca23776028014c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 43.397638 | 111 | 0.634673 |
4724dbefd2ee129ab09adde629a1d395f86212d7 | 15,027 | py | Python | src/api/bkuser_core/tests/categories/plugins/ldap/test_syncer.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/tests/categories/plugins/ldap/test_syncer.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/tests/categories/plugins/ldap/test_syncer.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 43.430636 | 115 | 0.39256 |
85c34034a088ce279632cc38fc3e967055b6f95f | 30,777 | py | Python | struct2tensor/ops/struct2tensor_ops_test.py | rtg0795/struct2tensor | de38a2b7df93f286f52e781c7b6b86cacaff8fde | [
"Apache-2.0"
] | null | null | null | struct2tensor/ops/struct2tensor_ops_test.py | rtg0795/struct2tensor | de38a2b7df93f286f52e781c7b6b86cacaff8fde | [
"Apache-2.0"
] | null | null | null | struct2tensor/ops/struct2tensor_ops_test.py | rtg0795/struct2tensor | de38a2b7df93f286f52e781c7b6b86cacaff8fde | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 42.160274 | 95 | 0.670468 |
61e5e8030e0ec974ab6119786cf3c4be0b93f23e | 311 | py | Python | src/utils/datasets_wrapper.py | fracivilization/distant_ner_using_thesaurus | cebfb2bd950123ce3ef18e501314778cc41de71e | [
"Apache-2.0"
] | null | null | null | src/utils/datasets_wrapper.py | fracivilization/distant_ner_using_thesaurus | cebfb2bd950123ce3ef18e501314778cc41de71e | [
"Apache-2.0"
] | null | null | null | src/utils/datasets_wrapper.py | fracivilization/distant_ner_using_thesaurus | cebfb2bd950123ce3ef18e501314778cc41de71e | [
"Apache-2.0"
] | null | null | null | from datasets import Dataset
import colt
@colt.register("HuggingFaceDataset")
class HuggingFaceDataset:
def __new__(cls, path: str):
return Dataset.load_from_disk(path)
@colt.register("ConllOutput")
class ConllOutput:
def __new__(cls, path: str):
return Dataset.load_from_disk(path)
| 20.733333 | 43 | 0.736334 |
e088d963d726d109fa90ea026b686c6cdafe3113 | 440 | py | Python | parseTelegram/DB.py | romankurnovskii/parsers | 9e908fff7fbbfbc9654008d947cfeb0b45318238 | [
"MIT"
] | 1 | 2021-03-26T08:51:48.000Z | 2021-03-26T08:51:48.000Z | parseTelegram/DB.py | romankurnovskii/parsers | 9e908fff7fbbfbc9654008d947cfeb0b45318238 | [
"MIT"
] | null | null | null | parseTelegram/DB.py | romankurnovskii/parsers | 9e908fff7fbbfbc9654008d947cfeb0b45318238 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
client = MongoClient('127.0.0.1', 27017)
db = client['telegram_users'] # database
telegram_users = db.telegramUsers
def insertIntoMongoDB(users):
for user in users:
if not isExists(telegram_users, user):
telegram_users.insert_one(user)
def isExists(collectio... | 24.444444 | 55 | 0.679545 |
25c36477380467659f7df87cc6176990542d50fa | 985 | py | Python | tapis_cli/commands/taccapis/v2/profiles/list.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 8 | 2020-10-18T22:48:23.000Z | 2022-01-10T09:16:14.000Z | tapis_cli/commands/taccapis/v2/profiles/list.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 238 | 2019-09-04T14:37:54.000Z | 2020-04-15T16:24:24.000Z | tapis_cli/commands/taccapis/v2/profiles/list.py | bpachev/tapis-cli | c3128fb5b63ef74e06b737bbd95ef28fb24f0d32 | [
"BSD-3-Clause"
] | 5 | 2019-09-20T04:23:49.000Z | 2020-01-16T17:45:14.000Z | from tapis_cli.display import Verbosity
from . import API_NAME, SERVICE_VERSION
from .models import Profile
from .formatters import ProfilesFormatMany
__all__ = ['ProfilesList']
class ProfilesList(ProfilesFormatMany):
"""List all Profiles (requires administrative privileges)
"""
VERBOSITY = Verbosity.LI... | 30.78125 | 73 | 0.680203 |
72c57447e6a9aebb86b7b562d908d341cc1f5375 | 4,222 | py | Python | purity_fb/purity_fb_1dot11/models/directoryservice_nfs.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot11/models/directoryservice_nfs.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot11/models/directoryservice_nfs.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.11 Python SDK
Pure Storage FlashBlade REST 1.11 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.11
Contact... | 27.415584 | 205 | 0.577215 |
f1aabb431b42069edd35db2e39a565d9a02d988c | 2,668 | py | Python | source/config/setupcfg.py | vishal-rane/python-hpedockerplugin | 0cbc9bcb8179559ca7ca634e2a7c3cf794f86453 | [
"Apache-2.0"
] | 1 | 2019-02-06T15:22:25.000Z | 2019-02-06T15:22:25.000Z | source/config/setupcfg.py | vishal-rane/python-hpedockerplugin | 0cbc9bcb8179559ca7ca634e2a7c3cf794f86453 | [
"Apache-2.0"
] | 1 | 2018-01-19T18:50:04.000Z | 2018-01-19T18:50:04.000Z | source/config/setupcfg.py | vishal-rane/python-hpedockerplugin | 0cbc9bcb8179559ca7ca634e2a7c3cf794f86453 | [
"Apache-2.0"
] | 1 | 2019-02-16T08:53:12.000Z | 2019-02-16T08:53:12.000Z | # (c) Copyright [2016] Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | 35.573333 | 77 | 0.659295 |
a10a55e6aa49168f80fde77bdd90087917fc3f1f | 8,711 | py | Python | tests/test_extract_async.py | shenek/python-streamson | 2b0bd041696e9c9a8c488aec3acc50dd0c56434e | [
"MIT"
] | null | null | null | tests/test_extract_async.py | shenek/python-streamson | 2b0bd041696e9c9a8c488aec3acc50dd0c56434e | [
"MIT"
] | 25 | 2020-05-31T22:11:36.000Z | 2021-04-19T22:17:10.000Z | tests/test_extract_async.py | shenek/python-streamson | 2b0bd041696e9c9a8c488aec3acc50dd0c56434e | [
"MIT"
] | null | null | null | import pytest
import streamson
from streamson.handler import BufferHandler, PythonConverterHandler
from streamson.output import Output
@pytest.mark.parametrize(
"convert,extract_path",
[
(None, True),
(None, False),
(lambda x: x, True),
(lambda x: x, False),
(lambda x:... | 29.231544 | 112 | 0.594421 |
d08248601192375c8193d054017d70e0bc304140 | 48 | py | Python | w3resource/Tuple/Tuple03.py | DanielPascualSenties/pythonw3 | f0355d1b640dec19e0b087797538204332111bb5 | [
"MIT"
] | null | null | null | w3resource/Tuple/Tuple03.py | DanielPascualSenties/pythonw3 | f0355d1b640dec19e0b087797538204332111bb5 | [
"MIT"
] | null | null | null | w3resource/Tuple/Tuple03.py | DanielPascualSenties/pythonw3 | f0355d1b640dec19e0b087797538204332111bb5 | [
"MIT"
] | null | null | null | x = 1
y = 2
z = 3
tup = (x, y, z)
print(tup[1]) | 8 | 15 | 0.4375 |
24e758ad4ee032b262ff47167b9b663700093e2b | 19,582 | py | Python | 2020/day18/homework.py | UpwardTrajectory/advent-of-code | 8fc3ac3d6ef6a6b5d563af8eb2d91ec72c975f15 | [
"MIT"
] | null | null | null | 2020/day18/homework.py | UpwardTrajectory/advent-of-code | 8fc3ac3d6ef6a6b5d563af8eb2d91ec72c975f15 | [
"MIT"
] | null | null | null | 2020/day18/homework.py | UpwardTrajectory/advent-of-code | 8fc3ac3d6ef6a6b5d563af8eb2d91ec72c975f15 | [
"MIT"
] | null | null | null | samples = """1 + 2 * 3 + 4 * 5 + 6
1 + (2 * 3) + (4 * (5 + 6))
2 * 3 + (4 * 5)
5 + (8 * 3 + 9 + 3 * 4 * 3)
5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))
((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2"""
sample_answers = [71, 51, 26, 437, 12240, 13632]
sample_answers_p2 = [231, 51, 46, 1445, 669060, 23340]
problems = ""... | 50.339332 | 155 | 0.237974 |
9da95d079fef20573806fe09c238721067c375ed | 27,401 | py | Python | report_tools/renderers/googlecharts/gviz_api/gviz_api_test.py | steveblamey/django-report-tools | e12fe737a372925c7ce4969ed6e754d51cd9853b | [
"BSD-2-Clause"
] | 134 | 2015-01-07T20:32:04.000Z | 2022-03-20T06:06:27.000Z | adapters/property_adapter/gvizapi/gviz_api_test.py | PhoenixGlobal/Phoenix-Oracle | e4dc582bbb268b2015f89be91eded8df57556ae7 | [
"MIT"
] | 16 | 2015-01-14T15:18:06.000Z | 2021-08-16T16:38:05.000Z | adapters/property_adapter/gvizapi/gviz_api_test.py | PhoenixGlobal/Phoenix-Oracle | e4dc582bbb268b2015f89be91eded8df57556ae7 | [
"MIT"
] | 78 | 2015-01-28T22:47:22.000Z | 2022-03-20T06:06:40.000Z | #!/usr/bin/python
#
# Copyright (C) 2009 Google 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 ... | 47.488735 | 80 | 0.503376 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.