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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f752110515d030b2597797fc43b416cf23b6fcbd | 64,909 | py | Python | appengine/swarming/swarming_bot/client/isolateserver.py | amymariaparker2401/luci-py | c5902547adc12390df6b09c825a38370f1034e8b | [
"Apache-2.0"
] | null | null | null | appengine/swarming/swarming_bot/client/isolateserver.py | amymariaparker2401/luci-py | c5902547adc12390df6b09c825a38370f1034e8b | [
"Apache-2.0"
] | 1 | 2022-03-02T11:45:18.000Z | 2022-03-02T11:45:18.000Z | appengine/swarming/swarming_bot/client/isolateserver.py | Lees78/luci-py | 7b854c55f63e648005ae8aa38e2e41cd8f99feda | [
"Apache-2.0"
] | 1 | 2021-07-23T15:32:55.000Z | 2021-07-23T15:32:55.000Z | #!/usr/bin/env python
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Archives a set of files or directories to an Isolate Server."""
from __future__ import print_function
import collection... | 34.055089 | 105 | 0.668551 |
from __future__ import print_function
import collections
import errno
import functools
import logging
import optparse
import os
import re
import signal
import stat
import sys
import tarfile
import threading
import time
import zlib
from utils import net
from utils import tools
tools.force_local_third_party()
i... | true | true |
f752119b6133c4648e5544431749575baf9e9102 | 14,409 | py | Python | litex_setup.py | bl0x/litex | c3b94a347e1e4a14c11b82473a0951de81939477 | [
"ADSL"
] | null | null | null | litex_setup.py | bl0x/litex | c3b94a347e1e4a14c11b82473a0951de81939477 | [
"ADSL"
] | null | null | null | litex_setup.py | bl0x/litex | c3b94a347e1e4a14c11b82473a0951de81939477 | [
"ADSL"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import time
import subprocess
import shutil
import hashlib
import argparse
import urllib.request
start_time = time.time()
current_path = os.path.abspath(os.curdir)
# Helpers ------------------------------------------------------------------------------------------
def ... | 39.803867 | 146 | 0.59671 |
import os
import sys
import time
import subprocess
import shutil
import hashlib
import argparse
import urllib.request
start_time = time.time()
current_path = os.path.abspath(os.curdir)
def colorer(s, color="bright"):
header = {
"bright" : "\x1b[1m",
"green" : "\x1b[1m\x1b[32m",
... | true | true |
f752157b7693147490e07733554cb599d4a3b4cc | 1,706 | py | Python | profiles_api/migrations/0001_initial.py | vigneshsweekaran/profiles-rest-api-1 | 8df1fb262f4d00b20cfbc15440747159c85df588 | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | vigneshsweekaran/profiles-rest-api-1 | 8df1fb262f4d00b20cfbc15440747159c85df588 | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | vigneshsweekaran/profiles-rest-api-1 | 8df1fb262f4d00b20cfbc15440747159c85df588 | [
"MIT"
] | 1 | 2020-11-22T17:00:42.000Z | 2020-11-22T17:00:42.000Z | # Generated by Django 2.2 on 2020-10-17 10:54
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
... | 50.176471 | 266 | 0.638921 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.Au... | true | true |
f75216882cb4cc38122759f16aa0eb4b614dae1f | 3,204 | py | Python | lbry/wallet/orchstr8/cli.py | robd003/lbry-sdk | 3fc538104d46c8d83ce1ce9e684b1c602f43f60c | [
"MIT"
] | 4,703 | 2015-09-10T20:49:05.000Z | 2019-06-20T01:34:38.000Z | lbry/wallet/orchstr8/cli.py | robd003/lbry-sdk | 3fc538104d46c8d83ce1ce9e684b1c602f43f60c | [
"MIT"
] | 1,934 | 2015-11-25T20:40:45.000Z | 2019-06-21T00:50:03.000Z | lbry/wallet/orchstr8/cli.py | robd003/lbry-sdk | 3fc538104d46c8d83ce1ce9e684b1c602f43f60c | [
"MIT"
] | 369 | 2015-12-05T21:18:07.000Z | 2019-06-10T12:40:50.000Z | import logging
import argparse
import asyncio
import aiohttp
from lbry import wallet
from lbry.wallet.orchstr8.node import (
Conductor,
get_lbcd_node_from_ledger,
get_lbcwallet_node_from_ledger
)
from lbry.wallet.orchstr8.service import ConductorService
def get_argument_parser():
parser = argparse.Ar... | 33.030928 | 107 | 0.669164 | import logging
import argparse
import asyncio
import aiohttp
from lbry import wallet
from lbry.wallet.orchstr8.node import (
Conductor,
get_lbcd_node_from_ledger,
get_lbcwallet_node_from_ledger
)
from lbry.wallet.orchstr8.service import ConductorService
def get_argument_parser():
parser = argparse.Ar... | true | true |
f75216a2bcb493ed94ff0a0153684ea5035223fd | 12,038 | py | Python | CryMOS/QV.py | michi7x7/pm-mos-model | 394d752b1165f5afd96520f1b6e2dbecc27fdc4b | [
"Apache-2.0"
] | 1 | 2021-11-26T08:40:40.000Z | 2021-11-26T08:40:40.000Z | CryMOS/QV.py | michi7x7/pm-mos-model | 394d752b1165f5afd96520f1b6e2dbecc27fdc4b | [
"Apache-2.0"
] | null | null | null | CryMOS/QV.py | michi7x7/pm-mos-model | 394d752b1165f5afd96520f1b6e2dbecc27fdc4b | [
"Apache-2.0"
] | 2 | 2021-12-06T21:56:27.000Z | 2021-12-08T09:58:24.000Z | import numpy as np
from .constants import *
from .Bulk import BulkModel, BulkModelFD, BulkModelTails
from .base import MosModelBase, writeable_property
from math import sqrt
from scipy.integrate import quad
__all__ = ['DefaultQV', 'BeckersQVpy',
'DiracQVpy', 'TailsQVpy',
'GildenblatQVpy', 'Defa... | 35.405882 | 129 | 0.584233 | import numpy as np
from .constants import *
from .Bulk import BulkModel, BulkModelFD, BulkModelTails
from .base import MosModelBase, writeable_property
from math import sqrt
from scipy.integrate import quad
__all__ = ['DefaultQV', 'BeckersQVpy',
'DiracQVpy', 'TailsQVpy',
'GildenblatQVpy', 'Defa... | true | true |
f75216e08c1b06b285c13ba21a4499474ed4beab | 1,879 | py | Python | lib/model/utils/blob.py | K2OKOH/da-faster-RCNN-ChineseComment | b88d1821779b9edc3f0f4a595e1f41c3bfdd7cab | [
"MIT"
] | 2 | 2021-07-03T08:12:15.000Z | 2021-11-13T08:19:35.000Z | lib/model/utils/blob.py | K2OKOH/da-faster-RCNN-ChineseComment | b88d1821779b9edc3f0f4a595e1f41c3bfdd7cab | [
"MIT"
] | 1 | 2021-01-21T07:07:47.000Z | 2021-01-21T07:07:47.000Z | lib/model/utils/blob.py | K2OKOH/da-faster-RCNN-ChineseComment | b88d1821779b9edc3f0f4a595e1f41c3bfdd7cab | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Blob helper functions."""
import numpy as np
# from scipy.misc impo... | 30.803279 | 75 | 0.601384 |
import numpy as np
import cv2
try:
xrange
except NameError:
xrange = range
def im_list_to_blob(ims):
max_shape = np.array([im.shape for im in ims]).max(axis=0)
num_images = len(ims)
blob = np.zeros((num_images, max_shape[0], max_shape[1], 3),
... | true | true |
f752170fb726c75bdb804f7c7b0508971424f11c | 4,333 | py | Python | src/accounts/models.py | jabhishek87/croma | 4fff327ea37fba3d5e90215db3a1b6860c309f74 | [
"bzip2-1.0.6",
"MIT"
] | 56 | 2017-11-25T05:13:17.000Z | 2022-01-27T15:14:44.000Z | src/accounts/models.py | jabhishek87/croma | 4fff327ea37fba3d5e90215db3a1b6860c309f74 | [
"bzip2-1.0.6",
"MIT"
] | 4 | 2018-12-10T18:16:36.000Z | 2020-06-15T07:34:04.000Z | src/accounts/models.py | jabhishek87/croma | 4fff327ea37fba3d5e90215db3a1b6860c309f74 | [
"bzip2-1.0.6",
"MIT"
] | 25 | 2018-05-03T19:26:27.000Z | 2021-12-20T08:38:06.000Z | from django.db import models
from django.db import models
from django.db.models.signals import pre_save
from django.conf import settings
from django.utils import timezone
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
class Hea... | 46.591398 | 113 | 0.690976 | from django.db import models
from django.db import models
from django.db.models.signals import pre_save
from django.conf import settings
from django.utils import timezone
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
class Hea... | true | true |
f75217aa3e5cf8dbdcab02fffbfd381ccefef812 | 12,090 | py | Python | main.py | johnnyapol/RPICovidScraper | 84a97847c80c320e2eed3fd161e9f175f83d14a5 | [
"MIT"
] | 13 | 2020-10-08T15:17:29.000Z | 2021-12-21T03:49:31.000Z | main.py | johnnyapol/RPICovidScraper | 84a97847c80c320e2eed3fd161e9f175f83d14a5 | [
"MIT"
] | 19 | 2020-10-03T19:58:10.000Z | 2021-09-28T15:01:57.000Z | main.py | johnnyapol/RPICovidScraper | 84a97847c80c320e2eed3fd161e9f175f83d14a5 | [
"MIT"
] | 8 | 2020-10-03T19:03:02.000Z | 2021-09-02T13:53:43.000Z | #!/usr/bin/env python3
# Usage: ./main.py
"""
Copyright (C) 2020-2021 John C. Allwein 'johnnyapol' (admin@johnnyapol.me)
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, includ... | 34.542857 | 460 | 0.643011 |
import os
import pickle
import requests
from random import choice
from subprocess import run
import sys
import traceback
from datetime import date, timedelta, datetime
from copy import deepcopy
from itertools import chain
from io import BytesIO
from bs4 import BeautifulSoup
from discord_webhook import DiscordEmbed, ... | true | true |
f7521839214cddab80e9fe4afa4ab48819981903 | 14,325 | py | Python | nova/api/metadata/handler.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,874 | 2015-01-04T05:18:34.000Z | 2022-03-31T03:30:28.000Z | nova/api/metadata/handler.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 40 | 2015-04-13T02:32:42.000Z | 2022-02-16T02:28:06.000Z | nova/api/metadata/handler.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,996 | 2015-01-04T15:11:51.000Z | 2022-03-31T11:03:13.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | 41.642442 | 79 | 0.609773 |
import hashlib
import hmac
import os
from oslo_log import log as logging
from oslo_utils import encodeutils
from oslo_utils import secretutils as secutils
from oslo_utils import strutils
import webob.dec
import webob.exc
from nova.api.metadata import base
from nova.api import wsgi
from nova import cac... | true | true |
f7521891c764be3fd5a83871dae0a981c71b714e | 21,538 | py | Python | setuptools/_distutils/command/bdist_rpm.py | hhartzer/setuptools | 588f8a944d16eb654183fab561054a80a71893a4 | [
"MIT"
] | null | null | null | setuptools/_distutils/command/bdist_rpm.py | hhartzer/setuptools | 588f8a944d16eb654183fab561054a80a71893a4 | [
"MIT"
] | null | null | null | setuptools/_distutils/command/bdist_rpm.py | hhartzer/setuptools | 588f8a944d16eb654183fab561054a80a71893a4 | [
"MIT"
] | null | null | null | """distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
import subprocess, sys, os
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.file_util import write_file
from distutils.errors import *
from distutils.sysconfi... | 37.134483 | 82 | 0.553162 |
import subprocess, sys, os
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.file_util import write_file
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log
class bdist_rpm(Command):
description = "create an RPM distributio... | true | true |
f75218c7ae0ec1ef681a2a62189340e506c1f777 | 11,611 | py | Python | src/lib/datasets/dataset/vid_eval.py | nerminsamet/HoughNet-VID | 670405e002e1c4d60596434db4790783eaf62846 | [
"MIT"
] | 5 | 2021-04-26T12:46:14.000Z | 2021-09-15T15:17:35.000Z | src/lib/datasets/dataset/vid_eval.py | nerminsamet/HoughNet-VID | 670405e002e1c4d60596434db4790783eaf62846 | [
"MIT"
] | 1 | 2021-09-06T05:22:32.000Z | 2021-09-07T15:11:18.000Z | src/lib/datasets/dataset/vid_eval.py | nerminsamet/HoughNet-VID | 670405e002e1c4d60596434db4790783eaf62846 | [
"MIT"
] | 1 | 2021-07-01T13:42:15.000Z | 2021-07-01T13:42:15.000Z | import numpy as np
import scipy.io as sio
from collections import defaultdict
BIG_NUM = 1000000
def area(box, mode="xyxy"):
if mode == "xyxy":
TO_REMOVE = 1
area = (box[:, 2] - box[:, 0] + TO_REMOVE) * (box[:, 3] - box[:, 1] + TO_REMOVE)
elif mode == "xywh":
area = box[:, 2] * box[:, ... | 37.214744 | 116 | 0.552838 | import numpy as np
import scipy.io as sio
from collections import defaultdict
BIG_NUM = 1000000
def area(box, mode="xyxy"):
if mode == "xyxy":
TO_REMOVE = 1
area = (box[:, 2] - box[:, 0] + TO_REMOVE) * (box[:, 3] - box[:, 1] + TO_REMOVE)
elif mode == "xywh":
area = box[:, 2] * box[:, ... | true | true |
f7521927f08b17710480608cebcd9ef0a3c5d1db | 831 | py | Python | q2_treetime/methods.py | ebolyen/q2-treetime | 162ebfca9a120391840ed30ddef18fb2b780165e | [
"BSD-3-Clause"
] | 1 | 2020-04-10T22:17:34.000Z | 2020-04-10T22:17:34.000Z | q2_treetime/methods.py | ebolyen/q2-treetime | 162ebfca9a120391840ed30ddef18fb2b780165e | [
"BSD-3-Clause"
] | null | null | null | q2_treetime/methods.py | ebolyen/q2-treetime | 162ebfca9a120391840ed30ddef18fb2b780165e | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import skbio
import numpy as np
def add_node_names(tree: skbio.TreeNode, scheme: str = 'md5-xor') \
-> skbio.TreeNode:
HASH_SIZE = 128 // 8
for node in tree.postorder(include_self=True):
if not node.children or node.name is not None:
continue
xor = np.zero... | 17.3125 | 78 | 0.624549 | import hashlib
import skbio
import numpy as np
def add_node_names(tree: skbio.TreeNode, scheme: str = 'md5-xor') \
-> skbio.TreeNode:
HASH_SIZE = 128 // 8
for node in tree.postorder(include_self=True):
if not node.children or node.name is not None:
continue
xor = np.zero... | true | true |
f7521a750e38437ca6cb060b2fca948ff3b24625 | 2,242 | py | Python | backend/controllers/test_suite_param.py | Li-Vincent/leo-api-auto | a2d3fed97a71c2647af9620a7fa55633ad1d0a69 | [
"MIT"
] | 11 | 2020-06-09T07:30:38.000Z | 2021-07-14T05:28:25.000Z | backend/controllers/test_suite_param.py | herryshell/leo-api-auto | 15a2dabbc50fd2b31d33064320b11dd5cecaa2b1 | [
"MIT"
] | 3 | 2020-01-08T03:01:21.000Z | 2021-06-02T00:52:17.000Z | backend/controllers/test_suite_param.py | herryshell/leo-api-auto | 15a2dabbc50fd2b31d33064320b11dd5cecaa2b1 | [
"MIT"
] | 5 | 2020-06-09T14:46:35.000Z | 2021-07-28T08:03:27.000Z | from datetime import datetime
from bson import ObjectId
from flask import jsonify, request, current_app
from flask_security import login_required
from app import app
from models.test_suite_param import TestSuiteParam
from utils import common
# Not yet used
@app.route('/api/project/<project_id>/testEnv/<test_env_id... | 43.115385 | 119 | 0.707404 | from datetime import datetime
from bson import ObjectId
from flask import jsonify, request, current_app
from flask_security import login_required
from app import app
from models.test_suite_param import TestSuiteParam
from utils import common
@app.route('/api/project/<project_id>/testEnv/<test_env_id>/paramList', ... | true | true |
f7521ac35b7dd291b564abe435564e5f9bcf2c98 | 1,109 | py | Python | setup.py | theelous3/flask-io | 39745083a260bdda20d3a0712287aade9e0d8a97 | [
"MIT"
] | null | null | null | setup.py | theelous3/flask-io | 39745083a260bdda20d3a0712287aade9e0d8a97 | [
"MIT"
] | null | null | null | setup.py | theelous3/flask-io | 39745083a260bdda20d3a0712287aade9e0d8a97 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='flask-io',
version='1.14.1',
packages=['flask_io'],
url='https://github.com/viniciuschiele/flask-io',
license='MIT',
author='Vinicius Chiele',
author_email='vinicius.chiele@gmail.com',
description='Flask-IO is a library for parsing Flask request... | 41.074074 | 154 | 0.63661 | from setuptools import setup
setup(
name='flask-io',
version='1.14.1',
packages=['flask_io'],
url='https://github.com/viniciuschiele/flask-io',
license='MIT',
author='Vinicius Chiele',
author_email='vinicius.chiele@gmail.com',
description='Flask-IO is a library for parsing Flask request... | true | true |
f7521baf35f3a8e5f4c030423c0cb1d3e2e87a8f | 820 | py | Python | setup.py | trendscenter/coinstac_pyprofiler | 9a9eae0406a7ee655618993e33844503d48260c2 | [
"MIT"
] | null | null | null | setup.py | trendscenter/coinstac_pyprofiler | 9a9eae0406a7ee655618993e33844503d48260c2 | [
"MIT"
] | null | null | null | setup.py | trendscenter/coinstac_pyprofiler | 9a9eae0406a7ee655618993e33844503d48260c2 | [
"MIT"
] | null | null | null | """
Created on Mon Oct 26 16:23:24 2020
@author: Sunitha Basodi
"""
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt') as f:
required_packages = f.read().splitlines()
setuptools.setup(
name="coinstac_pyprofiler", # Replace with your own user... | 24.848485 | 65 | 0.682927 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt') as f:
required_packages = f.read().splitlines()
setuptools.setup(
name="coinstac_pyprofiler",
version="0.1.0",
author="Sunitha Basodi",
author_email="sunitha.basodi@gmail.com",
... | true | true |
f7521bf348f36ad2dac39b22df35eacb6d2d381b | 817 | py | Python | apex/pyprof/prof/randomSample.py | oyj0594/apex | b66ffc1d952d0b20d6706ada783ae5b23e4ee734 | [
"BSD-3-Clause"
] | 6,523 | 2018-04-25T17:35:27.000Z | 2022-03-31T22:49:45.000Z | apex/pyprof/prof/randomSample.py | oyj0594/apex | b66ffc1d952d0b20d6706ada783ae5b23e4ee734 | [
"BSD-3-Clause"
] | 1,100 | 2018-05-18T00:03:34.000Z | 2022-03-30T22:00:33.000Z | apex/pyprof/prof/randomSample.py | oyj0594/apex | b66ffc1d952d0b20d6706ada783ae5b23e4ee734 | [
"BSD-3-Clause"
] | 1,057 | 2018-05-07T13:53:04.000Z | 2022-03-31T09:18:47.000Z | from collections import OrderedDict
from .utility import Utility
from .base import OperatorLayerBase
class RandPerm(OperatorLayerBase):
def __init__(self, d):
marker = eval(d.argMarker[0])
mod = marker['mod']
op = marker['op']
args = marker['args']
self.marker = marker
self.mod_ = mod
self.op_ = op
... | 18.568182 | 64 | 0.651163 | from collections import OrderedDict
from .utility import Utility
from .base import OperatorLayerBase
class RandPerm(OperatorLayerBase):
def __init__(self, d):
marker = eval(d.argMarker[0])
mod = marker['mod']
op = marker['op']
args = marker['args']
self.marker = marker
self.mod_ = mod
self.op_ = op
... | true | true |
f7521bfe0c89eebec7df1fdb89737e19e761229c | 3,067 | py | Python | koans/about_strings.py | marlitas/python_koans | 52d041c09f4d98d9370776dd28f9553c7df03246 | [
"MIT"
] | null | null | null | koans/about_strings.py | marlitas/python_koans | 52d041c09f4d98d9370776dd28f9553c7df03246 | [
"MIT"
] | null | null | null | koans/about_strings.py | marlitas/python_koans | 52d041c09f4d98d9370776dd28f9553c7df03246 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(True, isinstance(string, str))
def test_single_quoted_strings_are_also_strings(self):
string =... | 32.284211 | 85 | 0.654711 |
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(True, isinstance(string, str))
def test_single_quoted_strings_are_also_strings(self):
string = 'Goodbye, world.'
self.assertEqual(... | true | true |
f7521c56e77254e87f9817a06bebb8c0ef995ec9 | 6,207 | py | Python | codespace/python/examples/pollbot.py | tzpBingo/github-trending | 05dc0a4a5aae91871a57b9c6db5d9faee243173e | [
"MIT"
] | 37 | 2017-10-12T01:50:42.000Z | 2022-02-24T02:44:45.000Z | codespace/python/examples/pollbot.py | tzpBingo/github-trending | 05dc0a4a5aae91871a57b9c6db5d9faee243173e | [
"MIT"
] | null | null | null | codespace/python/examples/pollbot.py | tzpBingo/github-trending | 05dc0a4a5aae91871a57b9c6db5d9faee243173e | [
"MIT"
] | 12 | 2018-07-31T10:04:56.000Z | 2022-02-07T00:08:06.000Z | #!/usr/bin/env python
# pylint: disable=C0116,W0613
# This program is dedicated to the public domain under the CC0 license.
"""
Basic example for a bot that works with polls. Only 3 people are allowed to interact with each
poll/quiz the bot generates. The preview command generates a closed poll/quiz, exactly like the
... | 35.067797 | 96 | 0.684711 |
import logging
from telegram import (
Poll,
ParseMode,
KeyboardButton,
KeyboardButtonPollType,
ReplyKeyboardMarkup,
ReplyKeyboardRemove,
Update,
)
from telegram.ext import (
Updater,
CommandHandler,
PollAnswerHandler,
PollHandler,
MessageHandler,
Filters,
Cal... | true | true |
f7521e031242dc25b1529f46150256ac12196a52 | 554 | py | Python | terra_layer/migrations/0012_auto_20190618_1500.py | Terralego/terra-layer | 6564a63d389503d3ae1f63ce46e674b228d6764b | [
"MIT"
] | 1 | 2019-08-08T15:17:32.000Z | 2019-08-08T15:17:32.000Z | terra_layer/migrations/0012_auto_20190618_1500.py | Terralego/terra-layer | 6564a63d389503d3ae1f63ce46e674b228d6764b | [
"MIT"
] | 65 | 2019-10-21T10:05:00.000Z | 2022-03-08T14:08:27.000Z | terra_layer/migrations/0012_auto_20190618_1500.py | Terralego/terra-layer | 6564a63d389503d3ae1f63ce46e674b228d6764b | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-06-18 13:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("terra_layer", "0011_auto_20190612_1721")]
operations = [
migrations.AlterField(
model_name="layer",
... | 25.181818 | 63 | 0.599278 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("terra_layer", "0011_auto_20190612_1721")]
operations = [
migrations.AlterField(
model_name="layer",
name="source",
field=models.For... | true | true |
f7521ee0f8c71369c0ab4ae4cbeadb942daea49d | 126 | py | Python | DBweb/store/urls.py | M-jo2/Messagerie-django | 8874d6d47fa11df5e84871500e7f534a47fb7b71 | [
"MIT"
] | 1 | 2020-10-19T12:35:10.000Z | 2020-10-19T12:35:10.000Z | DBweb/store/urls.py | M-jo2/Messagerie-django | 8874d6d47fa11df5e84871500e7f534a47fb7b71 | [
"MIT"
] | null | null | null | DBweb/store/urls.py | M-jo2/Messagerie-django | 8874d6d47fa11df5e84871500e7f534a47fb7b71 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'connect', views.connect, name='connexion')
]
| 15.75 | 52 | 0.706349 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'connect', views.connect, name='connexion')
]
| true | true |
f7521f14efc7fdc117df9d96f3b17f430ca13d16 | 876 | py | Python | google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/proto/proto1.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/proto/proto1.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/proto/proto1.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2016 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 law or ag... | 46.105263 | 78 | 0.785388 |
class ProtocolBufferDecodeError(Exception): pass
class ProtocolBufferEncodeError(Exception): pass
class ProtocolBufferReturnError(Exception): pass
| true | true |
f7521f7551f29fc0179a4d5c1291d3730f3f3915 | 5,550 | py | Python | nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2019-01-25T18:20:51.000Z | 2019-07-30T20:51:51.000Z | nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2018-01-25T19:48:17.000Z | 2019-01-25T18:20:52.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..brainsfit import BRAINSFit
def test_BRAINSFit_inputs():
input_map = dict(NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00=dict(argstr='--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00 ',
),
NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_... | 31.896552 | 114 | 0.677838 |
from __future__ import unicode_literals
from ..brainsfit import BRAINSFit
def test_BRAINSFit_inputs():
input_map = dict(NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00=dict(argstr='--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_00 ',
),
NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_01=dict(argstr='--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_... | true | true |
f7521fab65fba7ac2e70de5a56b4e36554fff9e1 | 624 | py | Python | WebAXEL/migrations/squashed_migrations/0053_auto_20200120_1535.py | xhackax47/AXEL_WEB | 917cdbdd79ae364327135e09abce9d058dc1271a | [
"MIT"
] | 1 | 2020-01-17T10:51:21.000Z | 2020-01-17T10:51:21.000Z | WebAXEL/migrations/squashed_migrations/0053_auto_20200120_1535.py | xhackax47/AXEL_WEB | 917cdbdd79ae364327135e09abce9d058dc1271a | [
"MIT"
] | 8 | 2021-03-30T12:35:54.000Z | 2022-03-12T00:11:34.000Z | WebAXEL/migrations/squashed_migrations/0053_auto_20200120_1535.py | xhackax47/AXEL_WEB | 917cdbdd79ae364327135e09abce9d058dc1271a | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-01-20 14:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('WebAXEL', '0052_auto_20200109_1300'),
]
operations = [
migrations.AddField(
model_name='dataset',
name='nb_vues',
... | 26 | 98 | 0.599359 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('WebAXEL', '0052_auto_20200109_1300'),
]
operations = [
migrations.AddField(
model_name='dataset',
name='nb_vues',
field=models.IntegerField(default=0, ... | true | true |
f75220bc367d71dd3a1afcfd50df6e0194725b2b | 2,869 | py | Python | object oriented programming(class).py | Pallavidighe2/Udemy-Practice-and-Project | fe35cb9fc5495ae5062b91330217e45e0ab68e3e | [
"MIT"
] | null | null | null | object oriented programming(class).py | Pallavidighe2/Udemy-Practice-and-Project | fe35cb9fc5495ae5062b91330217e45e0ab68e3e | [
"MIT"
] | null | null | null | object oriented programming(class).py | Pallavidighe2/Udemy-Practice-and-Project | fe35cb9fc5495ae5062b91330217e45e0ab68e3e | [
"MIT"
] | null | null | null |
"""
class student:
def __init__(self ,name , contact):
self.name=name
self.contact=contact
def getdata(self):
print("accept the data")
self.name=input("enter name")
self.contact=input("entaer contact")
def putdata(self):
print("the name of student is :"+s... | 19.650685 | 93 | 0.611363 |
f.harddisk = input("enter capacity of harddisk : ")
def putspec(self):
print("computer name is : " +self.company ," and hardisk size is : "+ self.harddisk )
class laptop(computer):
def __init__(self,color):
self.color=color
def getcolor(self):
self.color = input("enter color... | true | true |
f752211ada4c6df1de2e50c45bfacb746af8dde5 | 920 | py | Python | platform/app/models/anomaly.py | mstapfner/fadip | 2a68f4a403d1fc0dc717e51910f1bb1446c17f72 | [
"MIT"
] | null | null | null | platform/app/models/anomaly.py | mstapfner/fadip | 2a68f4a403d1fc0dc717e51910f1bb1446c17f72 | [
"MIT"
] | null | null | null | platform/app/models/anomaly.py | mstapfner/fadip | 2a68f4a403d1fc0dc717e51910f1bb1446c17f72 | [
"MIT"
] | null | null | null | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, Boolean, String, DateTime
Base = declarative_base()
class Anomaly(Base):
__tablename__ = 'anomalies'
id = Column(Integer, primary_key=True)
query_name = Column(String)
datasource_id = Column(String)
de... | 36.8 | 85 | 0.728261 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, Boolean, String, DateTime
Base = declarative_base()
class Anomaly(Base):
__tablename__ = 'anomalies'
id = Column(Integer, primary_key=True)
query_name = Column(String)
datasource_id = Column(String)
de... | true | true |
f752230068026a8a3b9e80dc19bad25aa25bf57a | 7,364 | py | Python | desktop/core/ext-py/phoenixdb/phoenixdb/connection.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/phoenixdb/phoenixdb/connection.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/phoenixdb/phoenixdb/connection.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.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 use ... | 35.066667 | 112 | 0.657523 |
import logging
import uuid
import weakref
from phoenixdb import errors
from phoenixdb.cursor import Cursor
from phoenixdb.errors import ProgrammingError
from phoenixdb.meta import Meta
__all__ = ['Connection']
logger = logging.getLogger(__name__)
AVATICA_PROPERTIES = ('autoCommit', 'autocommit', 'rea... | true | true |
f75224d2463ca2512d7c2d50978dc468718edda4 | 130 | py | Python | wsgi.py | codymlewis/QuantumChess | 13d582204e295cb7255e897336a8266592604923 | [
"MIT"
] | null | null | null | wsgi.py | codymlewis/QuantumChess | 13d582204e295cb7255e897336a8266592604923 | [
"MIT"
] | null | null | null | wsgi.py | codymlewis/QuantumChess | 13d582204e295cb7255e897336a8266592604923 | [
"MIT"
] | null | null | null | from WebApp import RAS_APP as application # move statics to ./ before deployment
if __name__ == "__main__":
application.run()
| 32.5 | 80 | 0.746154 | from WebApp import RAS_APP as application
if __name__ == "__main__":
application.run()
| true | true |
f752256975ea939e4d0357fbfa42c12d5ac6c3da | 538 | py | Python | tests/diff_editor_test.py | ahamilton/diff-edit | eb5254961bbbb30ba4311c846b3347ebad105cf2 | [
"Artistic-2.0"
] | null | null | null | tests/diff_editor_test.py | ahamilton/diff-edit | eb5254961bbbb30ba4311c846b3347ebad105cf2 | [
"Artistic-2.0"
] | null | null | null | tests/diff_editor_test.py | ahamilton/diff-edit | eb5254961bbbb30ba4311c846b3347ebad105cf2 | [
"Artistic-2.0"
] | null | null | null | #!/usr/bin/env python3
import unittest
import diff_edit
class OverlayListTestCase(unittest.TestCase):
def test_overlay_list(self):
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], 0), [5, 6, 3, 4])
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], 3), [1, 2, 3, 5])
... | 26.9 | 88 | 0.604089 |
import unittest
import diff_edit
class OverlayListTestCase(unittest.TestCase):
def test_overlay_list(self):
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], 0), [5, 6, 3, 4])
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], 3), [1, 2, 3, 5])
self.assertEqual(... | true | true |
f7522696b838c564c8a33a014835b5e6988f312f | 3,484 | py | Python | linux_proc_extras/setup.py | chotiwat/integrations-core | 57a4437790cafcb769e120aa64d84aaecbf6a414 | [
"BSD-3-Clause"
] | 2 | 2019-04-03T17:21:38.000Z | 2020-02-04T16:28:05.000Z | linux_proc_extras/setup.py | chotiwat/integrations-core | 57a4437790cafcb769e120aa64d84aaecbf6a414 | [
"BSD-3-Clause"
] | 10 | 2018-02-27T19:06:07.000Z | 2021-08-30T03:23:26.000Z | linux_proc_extras/setup.py | chotiwat/integrations-core | 57a4437790cafcb769e120aa64d84aaecbf6a414 | [
"BSD-3-Clause"
] | 6 | 2018-01-09T21:37:20.000Z | 2020-05-26T09:28:09.000Z | # Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
import json
import re
here = path.abspath(path.dirname(__file__))
def parse_req_line(line):
line = line.strip()
if not line or line.startswith('--hash') or line[0]... | 28.793388 | 92 | 0.637199 |
from setuptools import setup
from codecs import open
from os import path
import json
import re
here = path.abspath(path.dirname(__file__))
def parse_req_line(line):
line = line.strip()
if not line or line.startswith('--hash') or line[0] == '#':
return None
req = line.rpartition('#')
if len(... | true | true |
f75226c39bb67e7adf764614f354109fcf4c57b7 | 1,226 | py | Python | controller.py | AnotherStudent/MVC_Calculator | 72fa0f8e060ecee009455b8bd2d2aca9ea064e2f | [
"MIT"
] | null | null | null | controller.py | AnotherStudent/MVC_Calculator | 72fa0f8e060ecee009455b8bd2d2aca9ea064e2f | [
"MIT"
] | null | null | null | controller.py | AnotherStudent/MVC_Calculator | 72fa0f8e060ecee009455b8bd2d2aca9ea064e2f | [
"MIT"
] | null | null | null | class CalcController:
def __init__(self, model, view):
self.model = model
self.model.OnResult = self.OnResult
self.model.OnError = self.OnError
self.view = view
self.model.AllClear()
# interface for view
def command(self, command):
if command in ['0','1','2'... | 31.435897 | 64 | 0.545677 | class CalcController:
def __init__(self, model, view):
self.model = model
self.model.OnResult = self.OnResult
self.model.OnError = self.OnError
self.view = view
self.model.AllClear()
def command(self, command):
if command in ['0','1','2','3','4','5','6','7'... | true | true |
f75227fe9446d7942bfe0a991bcf80b90a09ac56 | 26,584 | py | Python | sentinelhub/aws.py | vincegeoinfo/sentinelhub-py | 7802598c1b0846e26869894d8bee442a2f196b13 | [
"MIT"
] | null | null | null | sentinelhub/aws.py | vincegeoinfo/sentinelhub-py | 7802598c1b0846e26869894d8bee442a2f196b13 | [
"MIT"
] | null | null | null | sentinelhub/aws.py | vincegeoinfo/sentinelhub-py | 7802598c1b0846e26869894d8bee442a2f196b13 | [
"MIT"
] | null | null | null | """
Module for obtaining data from Amazon Web Service
"""
from abc import ABC, abstractmethod
import logging
import os.path
from .download import DownloadRequest, get_json, AwsDownloadFailedException
from .opensearch import get_tile_info, get_tile_info_id
from .time_utils import parse_time
from .config import SHConfi... | 40.462709 | 118 | 0.615445 |
from abc import ABC, abstractmethod
import logging
import os.path
from .download import DownloadRequest, get_json, AwsDownloadFailedException
from .opensearch import get_tile_info, get_tile_info_id
from .time_utils import parse_time
from .config import SHConfig
from .constants import AwsConstants, EsaSafeType, MimeTy... | true | true |
f7522a570cceb7e66cd54c894a7a50e3b0cb7da9 | 2,653 | py | Python | configs/implus/cifar100_sk2next29_6x24x4_r48.py | implus/mmclassification | 9dea853e3dfd52106e2aea6760fef1107045a3ca | [
"Apache-2.0"
] | null | null | null | configs/implus/cifar100_sk2next29_6x24x4_r48.py | implus/mmclassification | 9dea853e3dfd52106e2aea6760fef1107045a3ca | [
"Apache-2.0"
] | null | null | null | configs/implus/cifar100_sk2next29_6x24x4_r48.py | implus/mmclassification | 9dea853e3dfd52106e2aea6760fef1107045a3ca | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='CutMixImageClassifier',
#type='ImageClassifier',
cutmix_prob = 0.5,
cutmix_beta = 1.,
backbone=dict(
type='SK2NeXt29',
depth=29,
cardinality=6,
base_width=24,
scale=4,
ratio=48,
#cardinality=8,
#bot... | 28.223404 | 76 | 0.641161 |
model = dict(
type='CutMixImageClassifier',
cutmix_prob = 0.5,
cutmix_beta = 1.,
backbone=dict(
type='SK2NeXt29',
depth=29,
cardinality=6,
base_width=24,
scale=4,
ratio=48,
... | true | true |
f7522b58fe759ad02beb5ce374a125dcdde42486 | 2,841 | py | Python | sphinx/conf.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | 3 | 2022-03-20T19:23:27.000Z | 2022-03-25T06:55:28.000Z | sphinx/conf.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | null | null | null | sphinx/conf.py | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder
import os
import sys
import inspect
import importlib
sys.path.insert(0, os.path.abspath('..'))
## Project
package = 'lampe'
project = 'LAMPE'
copyright = '2021-2022, François Rozet'
repository = 'https://github.com/francois-rozet/lampe'
## Extensions
exten... | 24.491379 | 80 | 0.636748 |
import os
import sys
import inspect
import importlib
sys.path.insert(0, os.path.abspath('..'))
= 'lampe'
project = 'LAMPE'
copyright = '2021-2022, François Rozet'
repository = 'https://github.com/francois-rozet/lampe'
= [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.linkcode',
'sph... | true | true |
f7522cb8a6488c3e38ec4a141823c5d654f6386d | 453 | py | Python | gen_vid_from_images.py | trung6/yolo-object-detection | d13095e7e2f84175d7c14f90bc810c6205356d6c | [
"MIT"
] | null | null | null | gen_vid_from_images.py | trung6/yolo-object-detection | d13095e7e2f84175d7c14f90bc810c6205356d6c | [
"MIT"
] | 1 | 2021-12-13T20:06:40.000Z | 2021-12-13T20:06:40.000Z | gen_vid_from_images.py | NguyenDucTrung123/yolo-object-detection | d9658af39455121339b7c6c177b07ef8ded6990c | [
"MIT"
] | null | null | null | import cv2
import os, sys
import time
import matplotlib.pyplot as plt
inputFolder = r''
outPath = os.path.join(inputFolder,'outpy1.avi')
w = 1280
h = 960
out = cv2.VideoWriter(outPath, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'), 20, (w, h))
for fileName in os.listdir(inputFolder):
imgPath = os.path.join(inputFolder... | 25.166667 | 86 | 0.686534 | import cv2
import os, sys
import time
import matplotlib.pyplot as plt
inputFolder = r''
outPath = os.path.join(inputFolder,'outpy1.avi')
w = 1280
h = 960
out = cv2.VideoWriter(outPath, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'), 20, (w, h))
for fileName in os.listdir(inputFolder):
imgPath = os.path.join(inputFolder... | true | true |
f7522d2ca321ae026aceeb862d016255fdc67539 | 684 | py | Python | integrations/airflow/marquez_airflow/__init__.py | ravwojdyla/marquez | 8636604e5dcffe1832ea39d9b72e9bbab7b272db | [
"Apache-2.0"
] | null | null | null | integrations/airflow/marquez_airflow/__init__.py | ravwojdyla/marquez | 8636604e5dcffe1832ea39d9b72e9bbab7b272db | [
"Apache-2.0"
] | null | null | null | integrations/airflow/marquez_airflow/__init__.py | ravwojdyla/marquez | 8636604e5dcffe1832ea39d9b72e9bbab7b272db | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 34.2 | 74 | 0.739766 |
__author__ = """Marquez Project"""
__version__ = "0.13.1"
__all__ = ["DAG"]
from marquez_airflow.dag import DAG
| true | true |
f7522de8c27f7df8309c243f170330b1ff30b189 | 5,174 | py | Python | src/config/schema-transformer/logger.py | casek14/contrail-controller | 18e2572635370b3cb6da2731af049cbeb934f2bb | [
"Apache-2.0"
] | 1 | 2019-01-11T06:16:10.000Z | 2019-01-11T06:16:10.000Z | src/config/schema-transformer/logger.py | casek14/contrail-controller | 18e2572635370b3cb6da2731af049cbeb934f2bb | [
"Apache-2.0"
] | null | null | null | src/config/schema-transformer/logger.py | casek14/contrail-controller | 18e2572635370b3cb6da2731af049cbeb934f2bb | [
"Apache-2.0"
] | 1 | 2020-06-08T11:50:36.000Z | 2020-06-08T11:50:36.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
"""
Schema Transformer monitor logger
"""
from sandesh_common.vns.ttypes import Module
from cfgm_common.vnc_logger import ConfigServiceLogger
from schema_transformer.config_db import DBBaseST, VirtualNetw... | 40.740157 | 79 | 0.667375 |
from sandesh_common.vns.ttypes import Module
from cfgm_common.vnc_logger import ConfigServiceLogger
from schema_transformer.config_db import DBBaseST, VirtualNetworkST,\
RoutingInstanceST, ServiceChain
from schema_transformer.sandesh.st_introspect import ttypes as sandesh
class SchemaTransformerLogger(... | true | true |
f7522e4b7e5496ddc315323396c4d2c0daf74a32 | 564 | py | Python | bb8/kulka_testing_.py | CoderAryanAnand/fun_projects | 6891320a373bad539b6e7926ca868d56c560bc20 | [
"MIT"
] | null | null | null | bb8/kulka_testing_.py | CoderAryanAnand/fun_projects | 6891320a373bad539b6e7926ca868d56c560bc20 | [
"MIT"
] | null | null | null | bb8/kulka_testing_.py | CoderAryanAnand/fun_projects | 6891320a373bad539b6e7926ca868d56c560bc20 | [
"MIT"
] | null | null | null | from kulka import Kulka
import time
ADDR = 'XX:XX:XX:XX:XX:XX'
STEPS = 10
SPEED = 0x30
SLEEP_TIME = 0.3
def make_a_step(kulka, current_angle):
kulka.roll(SPEED, current_angle)
time.sleep(SLEEP_TIME)
kulka.roll(0, current_angle)
def make_a_circle(kulka, steps):
rotate_by = 360 ... | 17.090909 | 48 | 0.631206 | from kulka import Kulka
import time
ADDR = 'XX:XX:XX:XX:XX:XX'
STEPS = 10
SPEED = 0x30
SLEEP_TIME = 0.3
def make_a_step(kulka, current_angle):
kulka.roll(SPEED, current_angle)
time.sleep(SLEEP_TIME)
kulka.roll(0, current_angle)
def make_a_circle(kulka, steps):
rotate_by = 360 ... | true | true |
f7522f55dbcfedb0419d9ef9eebf8578998794db | 4,900 | py | Python | infinitystone/ui/views/domains.py | HieronymusCrouse/infinitystone | 8a4bd9b415c0b2267eba45efc04a00d891b1a8d8 | [
"BSD-3-Clause"
] | 1 | 2018-05-17T15:50:45.000Z | 2018-05-17T15:50:45.000Z | infinitystone/ui/views/domains.py | HieronymusCrouse/infinitystone | 8a4bd9b415c0b2267eba45efc04a00d891b1a8d8 | [
"BSD-3-Clause"
] | 32 | 2018-03-22T07:59:29.000Z | 2019-06-06T13:12:47.000Z | infinitystone/ui/views/domains.py | HieronymusCrouse/infinitystone | 8a4bd9b415c0b2267eba45efc04a00d891b1a8d8 | [
"BSD-3-Clause"
] | 10 | 2018-02-26T08:17:31.000Z | 2019-12-27T12:10:00.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Christiaan Frans Rademan <chris@fwiw.co.za>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the ... | 41.880342 | 79 | 0.566327 |
from luxon import g
from luxon import router
from luxon import register
from luxon import render_template
from luxon.utils.bootstrap4 import form
from infinitystone.ui.models.domains import infinitystone_domain
g.nav_menu.add('/System/Domains',
href='/system/domains',
... | true | true |
f7522fa784968e063e91d22b8f8464e041795b1c | 2,439 | py | Python | mmcv/cnn/__init__.py | Alsasolo/mmcv | 6dfc9312fa872c7fd63a5e6971e9ecca8e3d4ef1 | [
"Apache-2.0"
] | 3 | 2022-03-09T13:15:15.000Z | 2022-03-21T06:59:10.000Z | mmcv/cnn/__init__.py | Alsasolo/mmcv | 6dfc9312fa872c7fd63a5e6971e9ecca8e3d4ef1 | [
"Apache-2.0"
] | 1 | 2020-08-15T10:11:53.000Z | 2020-08-15T10:11:53.000Z | mmcv/cnn/__init__.py | Alsasolo/mmcv | 6dfc9312fa872c7fd63a5e6971e9ecca8e3d4ef1 | [
"Apache-2.0"
] | 1 | 2022-01-09T15:30:55.000Z | 2022-01-09T15:30:55.000Z | # Copyright (c) Open-MMLab. All rights reserved.
from .alexnet import AlexNet
# yapf: disable
from .bricks import (ACTIVATION_LAYERS, CONV_LAYERS, NORM_LAYERS,
PADDING_LAYERS, PLUGIN_LAYERS, UPSAMPLE_LAYERS,
ContextBlock, Conv2d, Conv3d, ConvAWS2d, ConvModule,
... | 58.071429 | 79 | 0.685527 |
from .alexnet import AlexNet
from .bricks import (ACTIVATION_LAYERS, CONV_LAYERS, NORM_LAYERS,
PADDING_LAYERS, PLUGIN_LAYERS, UPSAMPLE_LAYERS,
ContextBlock, Conv2d, Conv3d, ConvAWS2d, ConvModule,
ConvTranspose2d, ConvTranspose3d, ConvWS2d,
... | true | true |
f75230473845b2e6f62a71405c7ace0e42cf58b6 | 34,963 | py | Python | modules/adb.py | onlinesen/sample | 2cebf4b28ec0cde2c087fc12db43173b47c31248 | [
"Apache-2.0"
] | null | null | null | modules/adb.py | onlinesen/sample | 2cebf4b28ec0cde2c087fc12db43173b47c31248 | [
"Apache-2.0"
] | null | null | null | modules/adb.py | onlinesen/sample | 2cebf4b28ec0cde2c087fc12db43173b47c31248 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf8
import os
import time
from modules import android_users
#from modules import apktool
from modules import command
from modules import files
#from modules import report
from modules import strings
from modules import utils
from modules.logs import Logs
APKSIGNER_ENABLED = False
KEY_... | 31.669384 | 125 | 0.623802 |
import os
import time
from modules import android_users
from modules import command
from modules import files
from modules import strings
from modules import utils
from modules.logs import Logs
APKSIGNER_ENABLED = False
KEY_CLIENT_ID_BASE = 'client_id_base'
KEY_CLIENT_ID = "client_id"
KEY_SEARCH_CLIENT_ID = "sea... | true | true |
f752309b210d845188e2dd79f4c0b684ee367c35 | 2,285 | py | Python | cryptography/core/ROT.py | Adasumizox/crypto | 45cb3cd19007a1b319efea20137a04a83afcf975 | [
"MIT"
] | null | null | null | cryptography/core/ROT.py | Adasumizox/crypto | 45cb3cd19007a1b319efea20137a04a83afcf975 | [
"MIT"
] | null | null | null | cryptography/core/ROT.py | Adasumizox/crypto | 45cb3cd19007a1b319efea20137a04a83afcf975 | [
"MIT"
] | null | null | null | from hunspell import Hunspell
import string
class ROT:
ALPHABET_LETTER_COUNT = 26
ALPHABET = alphabet = string.ascii_letters
def __init__(self, shift: int = 13):
# shift cannot be negative
assert shift >= 0
self._shift = shift % self.ALPHABET_LETTER_COUNT
@property
def s... | 29.675325 | 84 | 0.614004 | from hunspell import Hunspell
import string
class ROT:
ALPHABET_LETTER_COUNT = 26
ALPHABET = alphabet = string.ascii_letters
def __init__(self, shift: int = 13):
assert shift >= 0
self._shift = shift % self.ALPHABET_LETTER_COUNT
@property
def shift(self):
return... | true | true |
f75230a4a89a7b1fe198f7b7a462d809610f4ae6 | 3,869 | py | Python | nni/retiarii/nn/pytorch/mutator.py | Yongxuanzhang/nni | 9caf5215d8a8ca8fb0729fc297f947699c1ca710 | [
"MIT"
] | null | null | null | nni/retiarii/nn/pytorch/mutator.py | Yongxuanzhang/nni | 9caf5215d8a8ca8fb0729fc297f947699c1ca710 | [
"MIT"
] | null | null | null | nni/retiarii/nn/pytorch/mutator.py | Yongxuanzhang/nni | 9caf5215d8a8ca8fb0729fc297f947699c1ca710 | [
"MIT"
] | null | null | null | from typing import Any, List, Optional
from ...mutator import Mutator
from ...graph import Model, Node
class LayerChoiceMutator(Mutator):
def __init__(self, nodes: List[Node]):
super().__init__()
self.nodes = nodes
def mutate(self, model):
n_candidates = len(self.nodes[0].operation.p... | 39.479592 | 108 | 0.672008 | from typing import Any, List, Optional
from ...mutator import Mutator
from ...graph import Model, Node
class LayerChoiceMutator(Mutator):
def __init__(self, nodes: List[Node]):
super().__init__()
self.nodes = nodes
def mutate(self, model):
n_candidates = len(self.nodes[0].operation.p... | true | true |
f7523114bf99bd77d0a85d83327301ac0e64f3bb | 3,183 | py | Python | mg/utils/midi2note.py | SJTMusicTeam/MusicGeneration | 289c5935da6c4d1cf8c8d2c56ea79971dd82a035 | [
"Apache-2.0"
] | 6 | 2021-01-26T05:21:46.000Z | 2021-12-10T12:57:29.000Z | mg/utils/midi2note.py | DrWelles/MusicGeneration | 2918e151a1b9448e5452179bab70bf565d1eaaf7 | [
"Apache-2.0"
] | 2 | 2021-01-31T08:57:43.000Z | 2021-02-26T03:43:11.000Z | mg/utils/midi2note.py | DrWelles/MusicGeneration | 2918e151a1b9448e5452179bab70bf565d1eaaf7 | [
"Apache-2.0"
] | 4 | 2021-01-11T04:53:47.000Z | 2022-01-12T04:17:44.000Z | from music21 import converter, instrument, note, chord, stream, midi
import numpy as np
import pandas as pd
# Melody-RNN Format is a sequence of 8-bit integers indicating the following:
# MELODY_NOTE_ON = [0, 127] # (note on at that MIDI pitch)
MELODY_NOTE_OFF = 128 # (stop playing all previous notes)
MELODY_NO_EVENT... | 44.208333 | 147 | 0.668552 | from music21 import converter, instrument, note, chord, stream, midi
import numpy as np
import pandas as pd
_NO_EVENT = 129
def streamToNoteArray(stream):
total_length = np.int(np.round(stream.flat.highestTime / 0.25))
stream_list = []
for element in stream.flat:
if isinstance(element, ... | true | true |
f752313e0970ca59b83f258bd28df6cfcb2a3979 | 878 | py | Python | instaproject/urls.py | Kerrykogei24/K-Gram | 16d9c88996d3d94d0372cf9d27ca0290751e76ec | [
"MIT"
] | null | null | null | instaproject/urls.py | Kerrykogei24/K-Gram | 16d9c88996d3d94d0372cf9d27ca0290751e76ec | [
"MIT"
] | null | null | null | instaproject/urls.py | Kerrykogei24/K-Gram | 16d9c88996d3d94d0372cf9d27ca0290751e76ec | [
"MIT"
] | null | null | null | """instaproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 33.769231 | 77 | 0.705011 | from django.contrib import admin
from django.conf.urls import include,url
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('instagram.urls')),
url(r'^accounts/',include('registration.backends.simple.urls')),
]
| true | true |
f75231a558334fdab54ace92773c4a1160259d8c | 499 | py | Python | homework_01_python/exercise_4.py | haohlin/Pattern-Recognition-Homework | 33d478c1fba4547007987485e46d351b51f334b1 | [
"Apache-2.0"
] | 2 | 2019-10-30T07:27:16.000Z | 2020-06-24T22:48:59.000Z | homework_01_python/exercise_4.py | haohlin/Pattern-Recognition-Homework | 33d478c1fba4547007987485e46d351b51f334b1 | [
"Apache-2.0"
] | null | null | null | homework_01_python/exercise_4.py | haohlin/Pattern-Recognition-Homework | 33d478c1fba4547007987485e46d351b51f334b1 | [
"Apache-2.0"
] | 1 | 2020-03-01T09:58:14.000Z | 2020-03-01T09:58:14.000Z | a = 1
b = 2
c = 3
d = 4
e = 5
f = 6
g = 7
h = 8
i = 9
list_1 = [a,b,c,d,e,f,g,h,i]
print (' ', end='')
for j in range(len(list_1)):
print (list_1[j], ' ', end='')
print('\n')
for j in range(len(list_1)):
print (j + 1, ' ', end='')
for k in range(len(list_1)):
print (list_1[j]*list_1[k], ' ', ... | 20.791667 | 49 | 0.43487 | a = 1
b = 2
c = 3
d = 4
e = 5
f = 6
g = 7
h = 8
i = 9
list_1 = [a,b,c,d,e,f,g,h,i]
print (' ', end='')
for j in range(len(list_1)):
print (list_1[j], ' ', end='')
print('\n')
for j in range(len(list_1)):
print (j + 1, ' ', end='')
for k in range(len(list_1)):
print (list_1[j]*list_1[k], ' ', ... | true | true |
f75231a855c040725796976930312f54737d5863 | 345 | py | Python | python/olm/__version__.py | louib/olm | 45091c158d956ebb6c23acfe4dcb1f147df55d4a | [
"Apache-2.0"
] | null | null | null | python/olm/__version__.py | louib/olm | 45091c158d956ebb6c23acfe4dcb1f147df55d4a | [
"Apache-2.0"
] | null | null | null | python/olm/__version__.py | louib/olm | 45091c158d956ebb6c23acfe4dcb1f147df55d4a | [
"Apache-2.0"
] | null | null | null | __title__ = "python-olm"
__description__ = ("python CFFI bindings for the olm "
"cryptographic ratchet library")
__url__ = "https://github.com/poljar/python-olm"
__version__ = "3.0.0"
__author__ = "Damir Jelić"
__author_email__ = "poljar@termina.org.uk"
__license__ = "Apache 2.0"
__copyright__ = "Cop... | 34.5 | 54 | 0.713043 | __title__ = "python-olm"
__description__ = ("python CFFI bindings for the olm "
"cryptographic ratchet library")
__url__ = "https://github.com/poljar/python-olm"
__version__ = "3.0.0"
__author__ = "Damir Jelić"
__author_email__ = "poljar@termina.org.uk"
__license__ = "Apache 2.0"
__copyright__ = "Cop... | true | true |
f752329dbc8fe300f5d1b56af1d2f8a28e232a16 | 4,371 | py | Python | src/pyneat/stagnation.py | adamtupper/pyneat | 12bf2bf936602c0da7c40cfcb99aced2eb981faa | [
"MIT"
] | null | null | null | src/pyneat/stagnation.py | adamtupper/pyneat | 12bf2bf936602c0da7c40cfcb99aced2eb981faa | [
"MIT"
] | null | null | null | src/pyneat/stagnation.py | adamtupper/pyneat | 12bf2bf936602c0da7c40cfcb99aced2eb981faa | [
"MIT"
] | null | null | null | """Track the progress of species and remove those that have stalled.
TODO: Add stagnation tests.
TODO: Update module docstrings, and clean up comments and code.
"""
import sys
from neat.config import ConfigParameter, DefaultClassConfig
from neat.math_util import stat_functions
# TODO: Add a method for the user to ch... | 37.042373 | 93 | 0.619767 | import sys
from neat.config import ConfigParameter, DefaultClassConfig
from neat.math_util import stat_functions
class Stagnation(DefaultClassConfig):
@classmethod
def parse_config(cls, param_dict):
return DefaultClassConfig(param_dict,
[ConfigParameter('species_fi... | true | true |
f75234612441254ca155b236cd1e37e8b4339ff3 | 398 | py | Python | mainclone/migrations/0005_auto_20180724_0814.py | newtonkiragu/Not-Instagram | 644f3c9fc0a446e3cab86100e0f0da8138c30492 | [
"MIT"
] | null | null | null | mainclone/migrations/0005_auto_20180724_0814.py | newtonkiragu/Not-Instagram | 644f3c9fc0a446e3cab86100e0f0da8138c30492 | [
"MIT"
] | 3 | 2020-06-05T18:48:43.000Z | 2021-09-07T23:59:25.000Z | mainclone/migrations/0005_auto_20180724_0814.py | newtonkiragu/Not-Instagram | 644f3c9fc0a446e3cab86100e0f0da8138c30492 | [
"MIT"
] | 3 | 2018-07-31T08:57:01.000Z | 2020-11-03T14:55:24.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-07-24 08:14
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mainclone', '0004_auto_20180724_0814'),
]
operations = [
migrations.RenameModel(
... | 19.9 | 49 | 0.620603 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mainclone', '0004_auto_20180724_0814'),
]
operations = [
migrations.RenameModel(
old_name='Comments',
new_name='Comment',
... | true | true |
f75234ea14a5f3ebeb9efa6768f8303862f7e3cb | 2,999 | py | Python | examples/stock/company.v.py | hwwhww/vyper | 28d506c272ddbfd1818a061fd345b5c9657a7e32 | [
"MIT"
] | 1 | 2020-07-22T14:51:22.000Z | 2020-07-22T14:51:22.000Z | examples/stock/company.v.py | hwwhww/vyper | 28d506c272ddbfd1818a061fd345b5c9657a7e32 | [
"MIT"
] | null | null | null | examples/stock/company.v.py | hwwhww/vyper | 28d506c272ddbfd1818a061fd345b5c9657a7e32 | [
"MIT"
] | null | null | null | # Own shares of a company!
company: public(address)
total_shares: public(currency_value)
price: public(num (wei / currency))
# Store ledger of stockholder holdings
holdings: currency_value[address]
# Setup company
def __init__(_company: address, _total_shares: currency_value,
initial_price: num(wei / currenc... | 32.247312 | 73 | 0.719573 |
company: public(address)
total_shares: public(currency_value)
price: public(num (wei / currency))
holdings: currency_value[address]
def __init__(_company: address, _total_shares: currency_value,
initial_price: num(wei / currency) ):
assert _total_shares > 0
assert initial_price > 0
self.c... | true | true |
f752351d78e28d4524a2dfce186a3e5dce0fdac9 | 2,653 | py | Python | backend/views/prices.py | colinmcintosh/Savvy | 67fb6490aeb94ae91c610f514d0d67e3f548c3b9 | [
"MIT"
] | null | null | null | backend/views/prices.py | colinmcintosh/Savvy | 67fb6490aeb94ae91c610f514d0d67e3f548c3b9 | [
"MIT"
] | null | null | null | backend/views/prices.py | colinmcintosh/Savvy | 67fb6490aeb94ae91c610f514d0d67e3f548c3b9 | [
"MIT"
] | null | null | null | import json
from flask import Blueprint
from flask import request
from flask import Response
from backend.auth import login_required, current_user
from backend.models.prices import PriceDB
from backend.utils import json_error, json_success, crossdomain
price_blueprint = Blueprint("prices", __name__, url_prefix="/api... | 31.963855 | 97 | 0.646815 | import json
from flask import Blueprint
from flask import request
from flask import Response
from backend.auth import login_required, current_user
from backend.models.prices import PriceDB
from backend.utils import json_error, json_success, crossdomain
price_blueprint = Blueprint("prices", __name__, url_prefix="/api... | true | true |
f75235992d05456e1c97a952681a2ac29a48774f | 2,260 | py | Python | tests/test_class_oelint_vars_notrailingslash.py | Rahix/oelint-adv | b9dc381b181a8bdc7300bb5070f80bf90950efbd | [
"BSD-2-Clause"
] | null | null | null | tests/test_class_oelint_vars_notrailingslash.py | Rahix/oelint-adv | b9dc381b181a8bdc7300bb5070f80bf90950efbd | [
"BSD-2-Clause"
] | null | null | null | tests/test_class_oelint_vars_notrailingslash.py | Rahix/oelint-adv | b9dc381b181a8bdc7300bb5070f80bf90950efbd | [
"BSD-2-Clause"
] | null | null | null | import os
import sys
import pytest
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from base import TestBaseClass
class TestClassOelintVarsNoTrailingSlash(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.vars.notrailingslash'])
@pytest.mark.parametrize('occurance', [1])
@pytest.ma... | 23.541667 | 67 | 0.375664 | import os
import sys
import pytest
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
from base import TestBaseClass
class TestClassOelintVarsNoTrailingSlash(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.vars.notrailingslash'])
@pytest.mark.parametrize('occurance', [1])
@pytest.ma... | true | true |
f752362593310dfe42aafcd8d000c9261a2cb16c | 3,754 | py | Python | python/venv/lib/python2.7/site-packages/openstack/tests/unit/test_connection.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | python/venv/lib/python2.7/site-packages/openstack/tests/unit/test_connection.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | python/venv/lib/python2.7/site-packages/openstack/tests/unit/test_connection.py | sjsucohort6/openstack | 8471e6e599c3f52319926a582358358ef84cbadb | [
"MIT"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 42.659091 | 75 | 0.628929 |
import mock
from openstack.auth.identity import v2
from openstack import connection
from openstack import profile
from openstack.tests.unit import base
from openstack import transport
class TestConnection(base.TestCase):
def setUp(self):
super(TestConnection, self).setUp()
self.xport ... | true | true |
f7523712f04d92834cf09420a4cb3259a34f8e23 | 1,627 | py | Python | p2p.py | MartinKist/p2p | 046c6258f936789aff73b884235b9b202e7e7f7a | [
"MIT"
] | 2 | 2021-06-29T11:32:59.000Z | 2021-06-30T09:11:24.000Z | p2p.py | MartinKist/p2p | 046c6258f936789aff73b884235b9b202e7e7f7a | [
"MIT"
] | null | null | null | p2p.py | MartinKist/p2p | 046c6258f936789aff73b884235b9b202e7e7f7a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# (c) 2021 Martin Kistler
import argparse
import sys
from twisted.logger import globalLogPublisher, ILogObserver, eventAsText
from zope.interface import provider
import requests
import defaults
from client import P2PClient
# argument parsing
parser = argparse.ArgumentParser()
parser.add_argum... | 31.288462 | 117 | 0.687154 |
import argparse
import sys
from twisted.logger import globalLogPublisher, ILogObserver, eventAsText
from zope.interface import provider
import requests
import defaults
from client import P2PClient
parser = argparse.ArgumentParser()
parser.add_argument('--debug', help='set logging level to debug', action='store_t... | true | true |
f7523828fbbea5ee9cdb72f75ec29ba98025b9ea | 10,941 | py | Python | examples/inspection/plot_partial_dependence.py | Ben3940/scikit-learn | adb47e7c142ce6d699cc5927925d448cb2c1ab91 | [
"BSD-3-Clause"
] | null | null | null | examples/inspection/plot_partial_dependence.py | Ben3940/scikit-learn | adb47e7c142ce6d699cc5927925d448cb2c1ab91 | [
"BSD-3-Clause"
] | null | null | null | examples/inspection/plot_partial_dependence.py | Ben3940/scikit-learn | adb47e7c142ce6d699cc5927925d448cb2c1ab91 | [
"BSD-3-Clause"
] | null | null | null | """
===============================================================
Partial Dependence and Individual Conditional Expectation Plots
===============================================================
Partial dependence plots show the dependence between the target function [2]_
and a set of features of interest, marginaliz... | 37.597938 | 88 | 0.734211 |
import pandas as pd
from sklearn.datasets import fetch_california_housing
from sklearn.model_selection import train_test_split
cal_housing = fetch_california_housing()
X = pd.DataFrame(cal_housing.data, columns=cal_housing.feature_names)
y = cal_housing.target
y -= y.mean()
X_train, X_test, y_train, y_test ... | true | true |
f7523861bf3ca34a23a663797de8153b5213a447 | 2,555 | py | Python | setup.py | AndersonReyes/jupyterlab_templates | d8f13ff4c10f041591f0498782b832118d66705e | [
"Apache-2.0"
] | null | null | null | setup.py | AndersonReyes/jupyterlab_templates | d8f13ff4c10f041591f0498782b832118d66705e | [
"Apache-2.0"
] | null | null | null | setup.py | AndersonReyes/jupyterlab_templates | d8f13ff4c10f041591f0498782b832118d66705e | [
"Apache-2.0"
] | null | null | null | from codecs import open
from os import path
from jupyter_packaging import (
combine_commands,
create_cmdclass,
ensure_python,
ensure_targets,
get_version,
install_npm,
)
from setuptools import find_packages, setup
pjoin = path.join
ensure_python(("2.7", ">=3.7"))
name = "jupyterlab_templates... | 26.340206 | 80 | 0.631311 | from codecs import open
from os import path
from jupyter_packaging import (
combine_commands,
create_cmdclass,
ensure_python,
ensure_targets,
get_version,
install_npm,
)
from setuptools import find_packages, setup
pjoin = path.join
ensure_python(("2.7", ">=3.7"))
name = "jupyterlab_templates... | true | true |
f7523898d6fb07826bfe1203d523e0cc30de6ec5 | 1,730 | py | Python | synthetic_sounds/classification_problems.py | i2mint/examples | 1dd52935f6f6175a17af9b8e5ee9e2b10b08cb7f | [
"Apache-2.0"
] | null | null | null | synthetic_sounds/classification_problems.py | i2mint/examples | 1dd52935f6f6175a17af9b8e5ee9e2b10b08cb7f | [
"Apache-2.0"
] | 1 | 2020-03-30T21:50:54.000Z | 2020-03-30T21:50:54.000Z | synthetic_sounds/classification_problems.py | i2mint/examples | 1dd52935f6f6175a17af9b8e5ee9e2b10b08cb7f | [
"Apache-2.0"
] | 1 | 2019-08-18T22:47:51.000Z | 2019-08-18T22:47:51.000Z | from typing import Iterable, Callable
import numpy as np
from examples.synthetic_sounds.util import (
seeds_to_wfs,
seed_to_wf_chk,
DFLT_SEEDS,
DFLT_CHUNKER,
chk_tag_gen,
frame_annots_to_chk_annots,
)
from sklearn.decomposition import PCA
from sklearn.svm import SVC
def make_frequency_groups(s... | 27.903226 | 85 | 0.685549 | from typing import Iterable, Callable
import numpy as np
from examples.synthetic_sounds.util import (
seeds_to_wfs,
seed_to_wf_chk,
DFLT_SEEDS,
DFLT_CHUNKER,
chk_tag_gen,
frame_annots_to_chk_annots,
)
from sklearn.decomposition import PCA
from sklearn.svm import SVC
def make_frequency_groups(s... | true | true |
f75238a12046175b7cad155f9f2693e75d908a2d | 20,567 | py | Python | sympy/geometry/entity.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2022-01-31T16:02:46.000Z | 2022-01-31T16:02:46.000Z | sympy/geometry/entity.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | null | null | null | sympy/geometry/entity.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2022-02-04T13:50:29.000Z | 2022-02-04T13:50:29.000Z | """The definition of the base geometrical entity with attributes common to
all derived geometrical entities.
Contains
========
GeometryEntity
GeometricSet
Notes
=====
A GeometryEntity is any object that has special geometric properties.
A GeometrySet is a superclass of any GeometryEntity that can also
be viewed as ... | 32.388976 | 130 | 0.573686 |
from sympy.core.basic import Basic
from sympy.core.containers import Tuple
from sympy.core.evalf import EvalfMixin, N
from sympy.core.numbers import oo
from sympy.core.symbol import Dummy
from sympy.core.sympify import sympify
from sympy.functions.elementary.trigonometric import cos, sin, atan
from sympy.matrices impo... | true | true |
f75238d477768e6c79e3bbf3c8a9725739a7c0a1 | 1,216 | py | Python | generate_data.py | not-a-hot-dog/parallelized-disease-modeling | e82d052b4841f1c545f4f5c65ce509f1a3418754 | [
"MIT"
] | null | null | null | generate_data.py | not-a-hot-dog/parallelized-disease-modeling | e82d052b4841f1c545f4f5c65ce509f1a3418754 | [
"MIT"
] | null | null | null | generate_data.py | not-a-hot-dog/parallelized-disease-modeling | e82d052b4841f1c545f4f5c65ce509f1a3418754 | [
"MIT"
] | 1 | 2020-05-05T21:30:07.000Z | 2020-05-05T21:30:07.000Z | import numpy as np
##Read in data matrix
data = np.load("data/matrix.npy")
print('Creating data...')
##Generate individual CSVs
S_init_data = data[:, :, 2]
I_init_data = data[:, :, 3]
R_init_data = data[:, :, 4]
isUS_data = data[:, :, 5]
#Use fixed beta and gamma for stable simulation
beta_data = 0.8 * np.ones(S_init... | 35.764706 | 57 | 0.691612 | import numpy as np
a/matrix.npy")
print('Creating data...')
2]
I_init_data = data[:, :, 3]
R_init_data = data[:, :, 4]
isUS_data = data[:, :, 5]
beta_data = 0.8 * np.ones(S_init_data.shape)
gamma_data = 0.01 * np.ones(S_init_data.shape)
dS_data = 0.01 * np.ones(S_init_data.shape)
dI_data = 0.3 * np.ones(S_init_da... | true | true |
f75238d6457c8357a5da67ab39ff93226c3f90cb | 1,266 | py | Python | checkov/cloudformation/checks/resource/aws/EKSSecretsEncryption.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | checkov/cloudformation/checks/resource/aws/EKSSecretsEncryption.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | checkov/cloudformation/checks/resource/aws/EKSSecretsEncryption.py | niradler/checkov | 2628c6f28a5604efe3877d6eacc3044d2b66b7b1 | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.cloudformation.checks.resource.base_resource_check import BaseResourceCheck
class EKSSecretsEncryption(BaseResourceCheck):
def __init__(self):
name = "Ensure EKS Cluster has Secrets Encryption Enabled"
id = "CKV_AWS_... | 45.214286 | 123 | 0.71564 | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.cloudformation.checks.resource.base_resource_check import BaseResourceCheck
class EKSSecretsEncryption(BaseResourceCheck):
def __init__(self):
name = "Ensure EKS Cluster has Secrets Encryption Enabled"
id = "CKV_AWS_... | true | true |
f75239a8db622ce41a2a38d0e066d8c23a60758a | 4,520 | py | Python | vendor-local/lib/python/celery/tests/test_backends/test_redis_unit.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 4 | 2015-05-08T16:58:53.000Z | 2019-09-06T05:30:59.000Z | vendor-local/lib/python/celery/tests/test_backends/test_redis_unit.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 2 | 2019-02-17T17:44:53.000Z | 2019-03-28T03:54:39.000Z | vendor-local/lib/python/celery/tests/test_backends/test_redis_unit.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 7 | 2015-05-21T15:38:29.000Z | 2019-10-28T23:39:06.000Z | from __future__ import absolute_import
from datetime import timedelta
from mock import Mock, patch
from celery import current_app
from celery import states
from celery.result import AsyncResult
from celery.registry import tasks
from celery.task import subtask
from celery.utils import cached_property, uuid
from celer... | 27.228916 | 75 | 0.618363 | from __future__ import absolute_import
from datetime import timedelta
from mock import Mock, patch
from celery import current_app
from celery import states
from celery.result import AsyncResult
from celery.registry import tasks
from celery.task import subtask
from celery.utils import cached_property, uuid
from celer... | true | true |
f75239bbb9042e06a08f858367361d09b0ad2c7e | 10,987 | py | Python | formulas/bernoulli_numbers.py | pascalmolin/fungrim | f498ad76a385fe7a3b932a314747b7aa2ff475da | [
"MIT"
] | null | null | null | formulas/bernoulli_numbers.py | pascalmolin/fungrim | f498ad76a385fe7a3b932a314747b7aa2ff475da | [
"MIT"
] | null | null | null | formulas/bernoulli_numbers.py | pascalmolin/fungrim | f498ad76a385fe7a3b932a314747b7aa2ff475da | [
"MIT"
] | null | null | null | from .expr import *
def_Topic(
Title("Bernoulli numbers and polynomials"),
Entries(
"ac8eca",
"1f88a4",
),
Section("Tables"),
Entries(
"aed6bd",
"588889",
),
Section("Generating functions"),
Entries(
"522b04",
"f79ff0",
),
Section(... | 38.017301 | 143 | 0.637481 | from .expr import *
def_Topic(
Title("Bernoulli numbers and polynomials"),
Entries(
"ac8eca",
"1f88a4",
),
Section("Tables"),
Entries(
"aed6bd",
"588889",
),
Section("Generating functions"),
Entries(
"522b04",
"f79ff0",
),
Section(... | true | true |
f7523a4366ca9e2c5e3f2447724af7cc16582bb8 | 266 | py | Python | l5kit/l5kit/configs/config.py | xiaoxiaoheimei/l5kit | 1ea2f8cecfe7ad974419bf5c8519ab3a21300119 | [
"Apache-2.0"
] | 5 | 2021-02-27T07:40:41.000Z | 2022-03-24T07:03:35.000Z | l5kit/l5kit/configs/config.py | phalanx-hk/l5kit | 92c88c4050b946b6828a47ddb3d13da9d87f9f7d | [
"Apache-2.0"
] | 1 | 2021-02-23T18:55:05.000Z | 2021-02-23T18:55:05.000Z | l5kit/l5kit/configs/config.py | phalanx-hk/l5kit | 92c88c4050b946b6828a47ddb3d13da9d87f9f7d | [
"Apache-2.0"
] | 2 | 2021-12-07T06:59:06.000Z | 2022-01-22T07:19:18.000Z | import yaml
def load_config_data(path: str) -> dict:
with open(path) as f:
cfg: dict = yaml.load(f, Loader=yaml.FullLoader)
return cfg
def save_config_data(data: dict, path: str) -> None:
with open(path, "w") as f:
yaml.dump(data, f)
| 20.461538 | 56 | 0.62782 | import yaml
def load_config_data(path: str) -> dict:
with open(path) as f:
cfg: dict = yaml.load(f, Loader=yaml.FullLoader)
return cfg
def save_config_data(data: dict, path: str) -> None:
with open(path, "w") as f:
yaml.dump(data, f)
| true | true |
f7523bdb410594e5a541ca654658d5b34e8c5fcc | 811 | py | Python | bblfsh_sonar_checks/checks/java/RSPEC-1221.py | juanjux/sonar-checks | 65e45ca93bcc59bd20a28f169b00ac4de9b7e98f | [
"Apache-2.0"
] | 3 | 2018-10-02T12:02:37.000Z | 2019-04-04T09:18:37.000Z | bblfsh_sonar_checks/checks/java/RSPEC-1221.py | juanjux/sonar-checks | 65e45ca93bcc59bd20a28f169b00ac4de9b7e98f | [
"Apache-2.0"
] | 6 | 2018-08-17T14:43:57.000Z | 2019-01-08T12:20:03.000Z | bblfsh_sonar_checks/checks/java/RSPEC-1221.py | juanjux/sonar-checks | 65e45ca93bcc59bd20a28f169b00ac4de9b7e98f | [
"Apache-2.0"
] | 3 | 2018-08-23T22:35:41.000Z | 2020-04-18T11:29:45.000Z | import bblfsh_sonar_checks.utils as utils
import bblfsh
def check(uast):
findings = []
bad_methods = (
('hashcode', 'int', 'hashCode'),
('tostring', 'String', 'toString'),
('equal', 'boolean', 'equals'),
)
for method in utils.get_methods(uast):
if "public"... | 30.037037 | 95 | 0.554871 | import bblfsh_sonar_checks.utils as utils
import bblfsh
def check(uast):
findings = []
bad_methods = (
('hashcode', 'int', 'hashCode'),
('tostring', 'String', 'toString'),
('equal', 'boolean', 'equals'),
)
for method in utils.get_methods(uast):
if "public"... | true | true |
f7523c29d3bab16520a12d7483de118a3d0c08d8 | 23,793 | py | Python | examples/text_summarization/prophetnet/evaluate/gigaword/bs_pyrouge.py | tanhanzhuo/PaddleNLP | d0d20678f2bec820570b4f09ca49cd402d20c3b6 | [
"Apache-2.0"
] | 1 | 2022-01-28T06:32:26.000Z | 2022-01-28T06:32:26.000Z | examples/text_summarization/prophetnet/evaluate/gigaword/bs_pyrouge.py | tanhanzhuo/PaddleNLP | d0d20678f2bec820570b4f09ca49cd402d20c3b6 | [
"Apache-2.0"
] | null | null | null | examples/text_summarization/prophetnet/evaluate/gigaword/bs_pyrouge.py | tanhanzhuo/PaddleNLP | d0d20678f2bec820570b4f09ca49cd402d20c3b6 | [
"Apache-2.0"
] | 1 | 2022-03-30T03:05:52.000Z | 2022-03-30T03:05:52.000Z | from __future__ import print_function, unicode_literals, division
import codecs
import logging
import os
import platform
import re
from functools import partial
from subprocess import check_output
from tempfile import mkdtemp
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser imp... | 36.104704 | 80 | 0.58824 | from __future__ import print_function, unicode_literals, division
import codecs
import logging
import os
import platform
import re
from functools import partial
from subprocess import check_output
from tempfile import mkdtemp
try:
from configparser import ConfigParser
except ImportError:
from ConfigParser imp... | true | true |
f7523d0a6e50bef72051d9b4e2c27753b138a21c | 11,353 | py | Python | openpype/hosts/nuke/plugins/load/load_mov.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | 1 | 2020-09-21T14:55:33.000Z | 2020-09-21T14:55:33.000Z | openpype/hosts/nuke/plugins/load/load_mov.py | jrsndl/pype | f9d80ef2c0663921291c5f47d24bea51fc43bac7 | [
"MIT"
] | null | null | null | openpype/hosts/nuke/plugins/load/load_mov.py | jrsndl/pype | f9d80ef2c0663921291c5f47d24bea51fc43bac7 | [
"MIT"
] | null | null | null | import nuke
from avalon.vendor import qargparse
from avalon import api, io
from openpype.api import get_current_project_settings
from openpype.hosts.nuke.api.lib import (
get_imageio_input_colorspace
)
def add_review_presets_config():
returning = {
"families": list(),
"representations": list()... | 32.623563 | 78 | 0.554039 | import nuke
from avalon.vendor import qargparse
from avalon import api, io
from openpype.api import get_current_project_settings
from openpype.hosts.nuke.api.lib import (
get_imageio_input_colorspace
)
def add_review_presets_config():
returning = {
"families": list(),
"representations": list()... | true | true |
f7523d8efe22320a320fad5750b4fc6098469e73 | 2,627 | py | Python | pym/gpio.py | 0xcdef/isnano_nmigen | b4c2d0805d14ab259fdb65d1054e188e60e90349 | [
"MIT"
] | 1 | 2022-01-10T02:21:40.000Z | 2022-01-10T02:21:40.000Z | pym/gpio.py | 0xcdef/isnano_nmigen | b4c2d0805d14ab259fdb65d1054e188e60e90349 | [
"MIT"
] | null | null | null | pym/gpio.py | 0xcdef/isnano_nmigen | b4c2d0805d14ab259fdb65d1054e188e60e90349 | [
"MIT"
] | null | null | null | from nmigen import *
from nmigen.lib.io import *
from nmigen_soc import wishbone
from nmigen_soc.memory import MemoryMap
__all__ = ["GpioCtrl"]
class DummyIO():
def __init__(self, width, name='io'):
self.o = Signal(width, name='%s_o'%name)
self.i = Signal(width, name='%s_i'%name)
self.oe =... | 31.650602 | 97 | 0.54587 | from nmigen import *
from nmigen.lib.io import *
from nmigen_soc import wishbone
from nmigen_soc.memory import MemoryMap
__all__ = ["GpioCtrl"]
class DummyIO():
def __init__(self, width, name='io'):
self.o = Signal(width, name='%s_o'%name)
self.i = Signal(width, name='%s_i'%name)
self.oe =... | true | true |
f7523db70ec4adb25c5980f298c3fa24cf34cd8f | 18,941 | py | Python | sdk/lusid/models/transaction_request.py | fossabot/lusid-sdk-python | 154a0232a00026d79379aec7196555f24d742ade | [
"MIT"
] | null | null | null | sdk/lusid/models/transaction_request.py | fossabot/lusid-sdk-python | 154a0232a00026d79379aec7196555f24d742ade | [
"MIT"
] | null | null | null | sdk/lusid/models/transaction_request.py | fossabot/lusid-sdk-python | 154a0232a00026d79379aec7196555f24d742ade | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.2321
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class TransactionRequest(object):
"""NOTE: This cla... | 38.110664 | 412 | 0.659997 |
import pprint
import re
import six
class TransactionRequest(object):
openapi_types = {
'transaction_id': 'str',
'type': 'str',
'instrument_identifiers': 'dict(str, str)',
'transaction_date': 'str',
'settlement_date': 'str',
'units': 'float',
'transact... | true | true |
f7523dda503f9313f7cae97277e6f99142d44db5 | 3,496 | py | Python | python/cudf_kafka/setup.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | 1 | 2021-12-17T19:28:00.000Z | 2021-12-17T19:28:00.000Z | python/cudf_kafka/setup.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | 1 | 2021-03-10T20:28:23.000Z | 2021-03-25T15:58:47.000Z | python/cudf_kafka/setup.py | sperlingxx/cudf | c681211df6253e1ceee9203658108980e7e93e3c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION.
import os
import shutil
import sysconfig
from distutils.sysconfig import get_python_lib
import numpy as np
from Cython.Build import cythonize
from setuptools import find_packages, setup
from setuptools.extension import Extension
import versioneer
install_requires = ["cudf", ... | 30.666667 | 78 | 0.621568 |
import os
import shutil
import sysconfig
from distutils.sysconfig import get_python_lib
import numpy as np
from Cython.Build import cythonize
from setuptools import find_packages, setup
from setuptools.extension import Extension
import versioneer
install_requires = ["cudf", "cython"]
cython_files = ["cudf_kafka/_l... | true | true |
f7523df6e4f2bb97e7b4d204c037edd60fe5a1b9 | 473 | py | Python | topnotchdev/files_widget/templatetags/files_widget_tags.py | redwerk/django-files-widget | 9336b90d488e0919856206eb0fc813338a3e66cd | [
"MIT"
] | 1 | 2016-06-21T10:06:53.000Z | 2016-06-21T10:06:53.000Z | topnotchdev/files_widget/templatetags/files_widget_tags.py | redwerk/django-files-widget | 9336b90d488e0919856206eb0fc813338a3e66cd | [
"MIT"
] | null | null | null | topnotchdev/files_widget/templatetags/files_widget_tags.py | redwerk/django-files-widget | 9336b90d488e0919856206eb0fc813338a3e66cd | [
"MIT"
] | null | null | null | import re
import urllib
from django import template
register = template.Library()
@register.filter
def thumbnail_format(path):
match = re.search(r'\.\w+$', path)
if match:
ext = match.group(0)
if ext.lower() in ['.gif', '.png']:
return 'PNG'
return 'JPEG'
@register.filter
de... | 18.192308 | 43 | 0.630021 | import re
import urllib
from django import template
register = template.Library()
@register.filter
def thumbnail_format(path):
match = re.search(r'\.\w+$', path)
if match:
ext = match.group(0)
if ext.lower() in ['.gif', '.png']:
return 'PNG'
return 'JPEG'
@register.filter
de... | true | true |
f7523e56d6e356ca9d8a2f92bd0dd8373e58c140 | 1,009 | py | Python | src/paper/migrations/0064_featuredpaper.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/paper/migrations/0064_featuredpaper.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/paper/migrations/0064_featuredpaper.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | # Generated by Django 2.2 on 2020-10-12 22:50
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('paper', '0063_paper_paper_... | 37.37037 | 150 | 0.652131 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('paper', '0063_paper_paper_type'),
]
operations = [
mig... | true | true |
f7523f042d4876f573ac844b0f4d8d93478daef2 | 7,537 | py | Python | src/comp_parser.py | Oliv4945/openschc | 175b8b5736bd3c91251366cc02849a8f0255627a | [
"MIT"
] | null | null | null | src/comp_parser.py | Oliv4945/openschc | 175b8b5736bd3c91251366cc02849a8f0255627a | [
"MIT"
] | null | null | null | src/comp_parser.py | Oliv4945/openschc | 175b8b5736bd3c91251366cc02849a8f0255627a | [
"MIT"
] | null | null | null | """
comp_parser.py transforms a packet dump into a dictionnary. Dictionnary
format is the following:
{
("field ID", position) : [value, field length in bits, fixed or variable ]
}
since field ID can be repeated, the index is the tuple field ID and position.
"""
from base_import import *
from schccomp import * # for c... | 40.304813 | 133 | 0.543187 |
from base_import import *
from schccomp import *
from binascii import hexlify, unhexlify
from struct import pack, unpack
option_names = {
1: T_COAP_OPT_IF_MATCH,
3: T_COAP_OPT_URI_HOST,
4: T_COAP_OPT_ETAG,
5: T_COAP_OPT_IF_NONE_MATCH,
6: T_COAP_OPT_OBS,
7: T_COAP_OPT_URI_PORT,
8: T_COAP_... | true | true |
f7523f72625ea074e6626e4424a07e22b7f86c70 | 1,626 | py | Python | scrapy/tests/test_spidermiddleware_offsite.py | ghrhomeDist/scrapy | 0f00b1602a534ec40e89b3e37513930f8050d18b | [
"BSD-3-Clause"
] | 1 | 2015-04-01T20:02:08.000Z | 2015-04-01T20:02:08.000Z | scrapy/tests/test_spidermiddleware_offsite.py | raiakash/scrapy | 80bb9fb5d2bb1b7a7988383d4e969ca331df655f | [
"BSD-3-Clause"
] | 2 | 2021-12-13T20:51:32.000Z | 2022-02-11T03:47:35.000Z | scrapy/tests/test_spidermiddleware_offsite.py | raiakash/scrapy | 80bb9fb5d2bb1b7a7988383d4e969ca331df655f | [
"BSD-3-Clause"
] | 1 | 2017-11-09T20:33:59.000Z | 2017-11-09T20:33:59.000Z | from unittest import TestCase
from scrapy.http import Response, Request
from scrapy.spider import BaseSpider
from scrapy.contrib.spidermiddleware.offsite import OffsiteMiddleware
class TestOffsiteMiddleware(TestCase):
def setUp(self):
self.spider = self._get_spider()
self.mw = OffsiteMiddleware(... | 33.183673 | 82 | 0.656212 | from unittest import TestCase
from scrapy.http import Response, Request
from scrapy.spider import BaseSpider
from scrapy.contrib.spidermiddleware.offsite import OffsiteMiddleware
class TestOffsiteMiddleware(TestCase):
def setUp(self):
self.spider = self._get_spider()
self.mw = OffsiteMiddleware(... | true | true |
f7523f820a74d5206d0ebb83851d36f903c12735 | 423 | py | Python | opensky/config.py | eclipseespilce/opensky-api | c81b9840309d583471270a1d72ed1d468600d565 | [
"MIT"
] | null | null | null | opensky/config.py | eclipseespilce/opensky-api | c81b9840309d583471270a1d72ed1d468600d565 | [
"MIT"
] | 1 | 2021-06-02T00:24:19.000Z | 2021-06-02T00:24:19.000Z | opensky/config.py | eclipseespilce/opensky-api | c81b9840309d583471270a1d72ed1d468600d565 | [
"MIT"
] | null | null | null | import os
class Config:
OPEN_SKY_START_POINT_LONGITUDE = float(os.environ.get('OPEN_SKY_MIDDLE_POINT_LONGITUDE', 13.41053))
OPEN_SKY_START_POINT_LATITUDE = float(os.environ.get('OPEN_SKY_MIDDLE_POINT_LATITUDE', 52.52437))
OPEN_SKY_FLY_DISTANCE_FROM_START_POINT = int(os.environ.get('OPEN_SKY_FLY_DISTANCE_F... | 47 | 111 | 0.808511 | import os
class Config:
OPEN_SKY_START_POINT_LONGITUDE = float(os.environ.get('OPEN_SKY_MIDDLE_POINT_LONGITUDE', 13.41053))
OPEN_SKY_START_POINT_LATITUDE = float(os.environ.get('OPEN_SKY_MIDDLE_POINT_LATITUDE', 52.52437))
OPEN_SKY_FLY_DISTANCE_FROM_START_POINT = int(os.environ.get('OPEN_SKY_FLY_DISTANCE_F... | true | true |
f7524024ab0763b29f227e599acb998734a1f507 | 1,631 | py | Python | study-drills/sdex29.py | dark-teal-coder/book-learn-python-the-hard-way | e63abddde8c29dcb1c24d8a98116a78b05be67eb | [
"MIT"
] | null | null | null | study-drills/sdex29.py | dark-teal-coder/book-learn-python-the-hard-way | e63abddde8c29dcb1c24d8a98116a78b05be67eb | [
"MIT"
] | null | null | null | study-drills/sdex29.py | dark-teal-coder/book-learn-python-the-hard-way | e63abddde8c29dcb1c24d8a98116a78b05be67eb | [
"MIT"
] | null | null | null | # Study Drills 29
# In this Study Drill, try to guess what you think the if-statement is and what it does.
# Try to answer these questions in your own words before moving on to the next exercise:
# 1. What do you think the if does to the code under it?
# 2. Why does the code under the if need to be indented four spac... | 29.654545 | 99 | 0.692826 |
# 4. Can you put other Boolean expressions from Exercise 27 in the if-statement? Try it.
# 5. What happens if you change the initial values for people, cats, and dogs?
people = 20
cats = 30
dogs = 15
if people < cats:
# if True:
print("Too many cats! The world is doomed!")
if people > cats:
# if False:
... | true | true |
f7524141b33dfed07bd0ce7f8d82a0fa05400cda | 272 | py | Python | lectures/admin.py | CASDON-MYSTERY/studentapp | 0fd942e963a10a02a6c9f358dd362cfd646eecc3 | [
"MIT"
] | null | null | null | lectures/admin.py | CASDON-MYSTERY/studentapp | 0fd942e963a10a02a6c9f358dd362cfd646eecc3 | [
"MIT"
] | null | null | null | lectures/admin.py | CASDON-MYSTERY/studentapp | 0fd942e963a10a02a6c9f358dd362cfd646eecc3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Day, Lecture_day_and_venue, Lecture,Recommended_text
# Register your models here.
admin.site.register(Day)
admin.site.register(Lecture_day_and_venue)
admin.site.register(Lecture)
admin.site.register(Recommended_text) | 30.222222 | 72 | 0.838235 | from django.contrib import admin
from .models import Day, Lecture_day_and_venue, Lecture,Recommended_text
admin.site.register(Day)
admin.site.register(Lecture_day_and_venue)
admin.site.register(Lecture)
admin.site.register(Recommended_text) | true | true |
f7524189ea21dcec995c6ed3106f7fd87c5524df | 441 | py | Python | mundo-3/ex090.py | GustavoMendel/curso-python | 2270734cc159cf44cf513184f1467a9040a7bc46 | [
"MIT"
] | null | null | null | mundo-3/ex090.py | GustavoMendel/curso-python | 2270734cc159cf44cf513184f1467a9040a7bc46 | [
"MIT"
] | null | null | null | mundo-3/ex090.py | GustavoMendel/curso-python | 2270734cc159cf44cf513184f1467a9040a7bc46 | [
"MIT"
] | null | null | null | print(f'\033[1:33m{"-"*40:^40}\033[m')
print(f'\033[1:33m{"DICIONÁRIO EM PYTHON":^40}\033[m')
print(f'\033[1:33m{"-"*40:^40}\033[m')
aluno = dict()
aluno['Nome'] = str(input('Nome: '))
aluno['Média'] = float(input(f'Média de {aluno["Nome"]}: '))
if aluno['Média'] >= 7:
aluno['Situação'] = '\033[1:32mAprovado\033[... | 27.5625 | 60 | 0.589569 | print(f'\033[1:33m{"-"*40:^40}\033[m')
print(f'\033[1:33m{"DICIONÁRIO EM PYTHON":^40}\033[m')
print(f'\033[1:33m{"-"*40:^40}\033[m')
aluno = dict()
aluno['Nome'] = str(input('Nome: '))
aluno['Média'] = float(input(f'Média de {aluno["Nome"]}: '))
if aluno['Média'] >= 7:
aluno['Situação'] = '\033[1:32mAprovado\033[... | true | true |
f75242eb885b2f24aed4be33ad92a9cadbe54049 | 6,403 | py | Python | Graph_MPPT.py | awardblvr/pv_mppt_test | 366015fd418448791b8470baf82e6ecb3686b17d | [
"MIT"
] | null | null | null | Graph_MPPT.py | awardblvr/pv_mppt_test | 366015fd418448791b8470baf82e6ecb3686b17d | [
"MIT"
] | null | null | null | Graph_MPPT.py | awardblvr/pv_mppt_test | 366015fd418448791b8470baf82e6ecb3686b17d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Import MPPT CSV data and plot it.
CSV format:
Volts,volts,amps,watts,state,mode_str,panelSN,resistance,timestamp
29.646,29.646,0.0,0.0,0,CR,B41J00052893,100000,20210913_120014.79
14.267,14.267,0.354,5.05,1,CR,B41J00052893,40.0,20210913_120016.16
"""
from __future__ import print_functi... | 34.424731 | 112 | 0.609246 |
from __future__ import print_function
import os
import sys
import argparse
from datetime import datetime as dt
import time
import pandas as pd
from numpy import *
import numpy as np
from mpl_toolkits.axes_grid1 import host_subplot
from mpl_toolkits import axisartist
import matplotlib.pyplot as plt
from matplotlib.ti... | true | true |
f752438210515ca14677be15e338538aef5d9fb6 | 4,733 | py | Python | flask_app.py | moonsats/paw | 2be56c0427e1e37eed7e92e8227c98cd82bd6340 | [
"MIT"
] | null | null | null | flask_app.py | moonsats/paw | 2be56c0427e1e37eed7e92e8227c98cd82bd6340 | [
"MIT"
] | null | null | null | flask_app.py | moonsats/paw | 2be56c0427e1e37eed7e92e8227c98cd82bd6340 | [
"MIT"
] | null | null | null | # -*- coding=utf-8 -*-
"""
주요 기능:
- 매매 신호 수신
- 매매 결과 송신
- 사용자 인증
사용례:
-
"""
##@@@ 모듈 import
##============================================================
##@@ Built-In 모듈
##------------------------------------------------------------
import os, sys
import requests
import time
import json
import z... | 25.722826 | 107 | 0.559053 |
coding='utf-8')
if len(params) == 0:
return 'No parameter'
params_str = ''
for key in params.keys():
params_str += 'key: {}, value: {}<br>'.format(key, params[key])
return params_str
@app.route('/send_post', methods=['GET'])
def send_post():
params = {
"param1": "test1",... | true | true |
f75244dded68ac3d0cf638b463d7be288c5a088b | 4,141 | py | Python | hw2/main.py | tjjh89017/compiler | 0395073c94f9c8c778decd9239397fb265ae9a2a | [
"MIT"
] | null | null | null | hw2/main.py | tjjh89017/compiler | 0395073c94f9c8c778decd9239397fb265ae9a2a | [
"MIT"
] | null | null | null | hw2/main.py | tjjh89017/compiler | 0395073c94f9c8c778decd9239397fb265ae9a2a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
def is_nonterminal(s):
return s.isupper()
def is_terminal(s):
return not is_nonterminal(s) and not s == "l"
def __calc(F, prod_list):
while __iter(F, prod_list):
pass
def __iter(F, prod_list):
change = False
for p in prod_list:
if __i... | 19.350467 | 87 | 0.606617 |
import sys
import os
def is_nonterminal(s):
return s.isupper()
def is_terminal(s):
return not is_nonterminal(s) and not s == "l"
def __calc(F, prod_list):
while __iter(F, prod_list):
pass
def __iter(F, prod_list):
change = False
for p in prod_list:
if __iter_prod(F, p):
change = True
return chan... | true | true |
f752451eb6ea412b99310d59eba01f2edb50a654 | 737 | py | Python | i_server.py | JakeMakesStuff/aurorame.me | 1fec7516eb05dfb58759f914ec29a2312ac7eeab | [
"Apache-2.0"
] | 1 | 2017-10-07T11:44:09.000Z | 2017-10-07T11:44:09.000Z | i_server.py | JakeMakesStuff/aurorame.me | 1fec7516eb05dfb58759f914ec29a2312ac7eeab | [
"Apache-2.0"
] | 1 | 2017-10-11T20:05:48.000Z | 2017-10-11T20:07:45.000Z | i_server.py | JakeMakesStuff/aurorame.me | 1fec7516eb05dfb58759f914ec29a2312ac7eeab | [
"Apache-2.0"
] | null | null | null | import os
from flask import Flask, send_file, abort
# Imports and stuff.
webserver = Flask(__name__)
# Defines the web server.
@webserver.route("/")
def acc_denied():
return "You cannot browse this subdomain."
# Denies access if user tries to browse the subdomain.
@webserver.route("/<path:imageid>")
... | 26.321429 | 61 | 0.616011 | import os
from flask import Flask, send_file, abort
webserver = Flask(__name__)
@webserver.route("/")
def acc_denied():
return "You cannot browse this subdomain."
@webserver.route("/<path:imageid>")
def i(imageid):
imageid = imageid.rstrip('/').split('.')[0]
x = False
for file in os.l... | true | true |
f7524534f5ae6a616c25eb35bccbc40aa3c509d7 | 525 | py | Python | tslearn/early_classification/__init__.py | andriyor/tslearn | 6c93071b385a89112b82799ae5870daeca1ab88b | [
"BSD-2-Clause"
] | 1,151 | 2020-04-30T08:24:14.000Z | 2022-03-29T22:12:01.000Z | tslearn/early_classification/__init__.py | andriyor/tslearn | 6c93071b385a89112b82799ae5870daeca1ab88b | [
"BSD-2-Clause"
] | 216 | 2017-05-10T23:33:10.000Z | 2020-04-30T07:28:26.000Z | tslearn/early_classification/__init__.py | andriyor/tslearn | 6c93071b385a89112b82799ae5870daeca1ab88b | [
"BSD-2-Clause"
] | 172 | 2017-06-02T11:53:50.000Z | 2020-04-22T15:29:13.000Z | """
The :mod:`tslearn.early_classification` module gathers early classifiers for
time series.
Such classifiers aim at performing prediction as early as possible (i.e. they
do not necessarily wait for the end of the series before prediction is
triggered).
**User guide:** See the :ref:`Early Classification <early>` sec... | 26.25 | 80 | 0.779048 |
from .early_classification import NonMyopicEarlyClassifier
__author__ = 'Romain Tavenard romain.tavenard[at]univ-rennes2.fr'
__all__ = [
"NonMyopicEarlyClassifier"
]
| true | true |
f752457df0bd516ac54e1f08100e80d605efd56c | 52,355 | py | Python | py_insightvm_sdk/models/host_name.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 2 | 2019-03-15T16:05:54.000Z | 2020-07-19T18:37:50.000Z | py_insightvm_sdk/models/host_name.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 1 | 2021-03-26T04:46:12.000Z | 2021-03-26T04:51:23.000Z | py_insightvm_sdk/models/host_name.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 342.189542 | 48,045 | 0.491548 |
import pprint
import re
import six
class HostName(object):
swagger_types = {
'name': 'str',
'source': 'str'
}
attribute_map = {
'name': 'name',
'source': 'source'
}
def __init__(self, name=None, source=None):
self._name = None
self._sour... | true | true |
f75245ee3cec8e15d5d762559823f11139e21708 | 1,530 | py | Python | IK_LexicographicalOrder.py | amukher3/Problem_solutions | 8fa6014a91f295d08cafb989024caa91d99211d9 | [
"Apache-2.0"
] | 1 | 2021-12-28T08:58:51.000Z | 2021-12-28T08:58:51.000Z | IK_LexicographicalOrder.py | amukher3/Coding | a330cb04b5dd5cc1c3cf69249417a71586441bc7 | [
"Apache-2.0"
] | null | null | null | IK_LexicographicalOrder.py | amukher3/Coding | a330cb04b5dd5cc1c3cf69249417a71586441bc7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 2 15:18:12 2020
@author: Abhishek Mukherjee
"""
#Lexicographic order
# N can be 10^5
#So, time complexity might matter!!
#Not in linear time.
#
# Complete the solve function below.
#
def solve(arr):
Words=list()
for i in range(len(arr)):
... | 23.90625 | 75 | 0.545752 |
def solve(arr):
Words=list()
for i in range(len(arr)):
Words.append(arr[i].split())
SortedWords=[]
from operator import itemgetter
SortedWords=sorted(Words,key=itemgetter(0))
Vals=[]
Keys=[]
for i in range(len(Words)):
... | true | true |
f75247f1ab160b3f92811429178b7fca80b2c9e6 | 1,663 | py | Python | examples/singleobjective/generational_genetic_algorithm_tsp.py | NatalieGvozdetska/jMetalPy | ab791b25ba025ccfde4f6be36b6fae254ece48ad | [
"MIT"
] | null | null | null | examples/singleobjective/generational_genetic_algorithm_tsp.py | NatalieGvozdetska/jMetalPy | ab791b25ba025ccfde4f6be36b6fae254ece48ad | [
"MIT"
] | null | null | null | examples/singleobjective/generational_genetic_algorithm_tsp.py | NatalieGvozdetska/jMetalPy | ab791b25ba025ccfde4f6be36b6fae254ece48ad | [
"MIT"
] | null | null | null | from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm
from jmetal.operator import BinaryTournamentSelection
from jmetal.operator.crossover import PMXCrossover
from jmetal.operator.mutation import PermutationSwapMutation
from jmetal.problem.singleobjective.tsp import TSP
from jmetal.util.densit... | 42.641026 | 79 | 0.761876 | from jmetal.algorithm.singleobjective.genetic_algorithm import GeneticAlgorithm
from jmetal.operator import BinaryTournamentSelection
from jmetal.operator.crossover import PMXCrossover
from jmetal.operator.mutation import PermutationSwapMutation
from jmetal.problem.singleobjective.tsp import TSP
from jmetal.util.densit... | true | true |
f7524808fc4977879bbd3fdfbed7b44365ec0bbc | 41,242 | py | Python | test/ext/test_hybrid.py | immerrr/sqlalchemy | 995fb577a64061a9cbab62b481c65a4c4d3e5a67 | [
"MIT"
] | 1 | 2021-12-11T19:03:57.000Z | 2021-12-11T19:03:57.000Z | test/ext/test_hybrid.py | taogeYT/sqlalchemy | e88dc004e6bcd1418cb8eb811d0aa580c2a44b8f | [
"MIT"
] | null | null | null | test/ext/test_hybrid.py | taogeYT/sqlalchemy | e88dc004e6bcd1418cb8eb811d0aa580c2a44b8f | [
"MIT"
] | null | null | null | from decimal import Decimal
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import LABEL_STYLE_TABLENAME_PLUS_COL
from sqlalchemy import literal_column
from sqlalchemy import Numeric
from sqlalchemy i... | 30.325 | 79 | 0.562727 | from decimal import Decimal
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import LABEL_STYLE_TABLENAME_PLUS_COL
from sqlalchemy import literal_column
from sqlalchemy import Numeric
from sqlalchemy i... | true | true |
f75248739f38bd8c6aabb26158772f74f33a7dab | 16,820 | py | Python | pyxfoil.py | jberkman/pyxfoil | 511cb0e2cdc7e2967bc53fa0276351ebf57a90bf | [
"MIT"
] | null | null | null | pyxfoil.py | jberkman/pyxfoil | 511cb0e2cdc7e2967bc53fa0276351ebf57a90bf | [
"MIT"
] | null | null | null | pyxfoil.py | jberkman/pyxfoil | 511cb0e2cdc7e2967bc53fa0276351ebf57a90bf | [
"MIT"
] | null | null | null | """PYXFOIL: XFOIL AUTOMATION USING PYTHON
Logan Halstrom
EAE 127
UCD
CREATED: 15 SEP 2015
MODIFIED: 17 OCT 2018
DESCRIPTION: Provides functions for automating XFOIL runs.
Each function will iteratively build a list of inputs. When you are ready,
use the RunXfoil command to run the input list
NOTE: Since input list i... | 34.968815 | 88 | 0.571165 |
import os
import sys
import re
import numpy as np
import subprocess
import pandas as pd
| true | true |
f75248a5343c678f9b559aa1284b5037beb3d826 | 5,524 | py | Python | padertorch/contrib/je/data/mixup.py | michael-kuhlmann/padertorch | 3925fa693299ffb166d82dd81deed997237e85c7 | [
"MIT"
] | null | null | null | padertorch/contrib/je/data/mixup.py | michael-kuhlmann/padertorch | 3925fa693299ffb166d82dd81deed997237e85c7 | [
"MIT"
] | null | null | null | padertorch/contrib/je/data/mixup.py | michael-kuhlmann/padertorch | 3925fa693299ffb166d82dd81deed997237e85c7 | [
"MIT"
] | null | null | null | from lazy_dataset import Dataset, FilterException
import numpy as np
import numbers
class MixUpDataset(Dataset):
"""
>>> ds = MixUpDataset(range(10), SampleMixupComponents((.0,1.)), (lambda x: x), buffer_size=2)
>>> list(ds)
"""
def __init__(self, input_dataset, sample_fn, mixup_fn, buffer_size=10... | 39.741007 | 188 | 0.585264 | from lazy_dataset import Dataset, FilterException
import numpy as np
import numbers
class MixUpDataset(Dataset):
def __init__(self, input_dataset, sample_fn, mixup_fn, buffer_size=100):
self.input_dataset = input_dataset
self.buffer = []
self.buffer_size = buffer_size
self.sample_f... | true | true |
f752493a98b105563dfee6f50345d417b5066e15 | 511 | py | Python | djangocms_personalisation/migrations/0003_personalisationredirectpluginmodel_delay.py | divio/djangocms-personalisation | 15f52e0911da884c3d96ec3e634dee3c47325f0c | [
"BSD-3-Clause"
] | 1 | 2019-09-07T21:39:39.000Z | 2019-09-07T21:39:39.000Z | djangocms_personalisation/migrations/0003_personalisationredirectpluginmodel_delay.py | divio/djangocms-personalisation | 15f52e0911da884c3d96ec3e634dee3c47325f0c | [
"BSD-3-Clause"
] | null | null | null | djangocms_personalisation/migrations/0003_personalisationredirectpluginmodel_delay.py | divio/djangocms-personalisation | 15f52e0911da884c3d96ec3e634dee3c47325f0c | [
"BSD-3-Clause"
] | 1 | 2021-08-20T21:16:38.000Z | 2021-08-20T21:16:38.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangocms_personalisation', '0002_personalisationredirectpluginmodel'),
]
operations = [
migrations.AddField(
mo... | 25.55 | 100 | 0.675147 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangocms_personalisation', '0002_personalisationredirectpluginmodel'),
]
operations = [
migrations.AddField(
model_name='personalisati... | true | true |
f75249eb83097caa826c7273fbac1b310e4c7c46 | 6,927 | py | Python | experiments/graph_coloring/datasets/graph_coloring_generation.py | achinta/CategoricalNF | d8717a037e8f13641e9d9a89abf66fba38e23f91 | [
"MIT"
] | 47 | 2020-06-20T10:00:39.000Z | 2022-03-08T13:41:45.000Z | experiments/graph_coloring/datasets/graph_coloring_generation.py | achinta/CategoricalNF | d8717a037e8f13641e9d9a89abf66fba38e23f91 | [
"MIT"
] | 1 | 2020-07-05T20:58:19.000Z | 2020-09-08T12:45:29.000Z | experiments/graph_coloring/datasets/graph_coloring_generation.py | achinta/CategoricalNF | d8717a037e8f13641e9d9a89abf66fba38e23f91 | [
"MIT"
] | 10 | 2020-07-05T17:18:40.000Z | 2022-01-07T03:17:40.000Z | import random
import numpy as np
import networkx as nx
import sys, os, json, argparse, itertools
import grinpy as gp
import time
from glob import glob
from multiprocessing import Pool
from ortools.sat.python import cp_model
"""
This code is based on https://github.com/machine-reasoning-ufrgs/GNN-GCP
"""
def solve_cs... | 33.143541 | 132 | 0.691208 | import random
import numpy as np
import networkx as nx
import sys, os, json, argparse, itertools
import grinpy as gp
import time
from glob import glob
from multiprocessing import Pool
from ortools.sat.python import cp_model
def solve_csp(M, n_colors, nmin=25):
model = cp_model.CpModel()
N = len(M)
variables = ... | true | true |
f7524ac2efe5d5bd84980ed7698b0504e9ba2d60 | 3,490 | py | Python | meiduo_mall/meiduo_mall/apps/verifications/views.py | Nicholas-violet/meiduo_project_formal | 7ef674f4208e496ec1a5474e68672dbd1c2c077b | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/verifications/views.py | Nicholas-violet/meiduo_project_formal | 7ef674f4208e496ec1a5474e68672dbd1c2c077b | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/verifications/views.py | Nicholas-violet/meiduo_project_formal | 7ef674f4208e496ec1a5474e68672dbd1c2c077b | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
import logging
logger = logging.getLogger('django')
from django import http
import random
from django.views import View
from django_redis import get_redis_connection
from meiduo_mall.libs.captcha.captcha import captcha
# from meiduo_mall.libs.yuntongxun.ccp... | 26.846154 | 66 | 0.575358 | from django.shortcuts import render
import logging
logger = logging.getLogger('django')
from django import http
import random
from django.views import View
from django_redis import get_redis_connection
from meiduo_mall.libs.captcha.captcha import captcha
from celery_tasks.sms.tasks import ccp_send_sms_code
class ... | true | true |
f7524bd5adc827f8051fe91de74d42c4a8812379 | 736 | py | Python | examples/01-basic/03-switch-evaluation/test_switch.py | fragmuffin/upytester | 09b213ddcadff27ab72715024a3500a3569640ef | [
"MIT"
] | 4 | 2019-02-04T04:47:20.000Z | 2021-12-08T02:37:08.000Z | examples/01-basic/03-switch-evaluation/test_switch.py | fragmuffin/upytester | 09b213ddcadff27ab72715024a3500a3569640ef | [
"MIT"
] | 2 | 2019-04-22T22:09:24.000Z | 2020-09-08T04:46:38.000Z | examples/01-basic/03-switch-evaluation/test_switch.py | fragmuffin/upytester | 09b213ddcadff27ab72715024a3500a3569640ef | [
"MIT"
] | null | null | null | import time
import unittest
import upytester
# ------------ Bench Environment ------------
class Switch(object):
def __init__(self, device):
self.device = device
@property
def value(self):
return self.device.get_switch()()['value']
class BenchTest(unittest.TestCase):
@classmethod
... | 21.028571 | 57 | 0.605978 | import time
import unittest
import upytester
class Switch(object):
def __init__(self, device):
self.device = device
@property
def value(self):
return self.device.get_switch()()['value']
class BenchTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.pyb_a = up... | true | true |
f7524c4870b0ef2d80d50df5dbb50c2449df6db2 | 1,625 | py | Python | kaori/plugins/gacha/engine/test/card_simulator.py | austinpray/kaori | b21c4146b9d0d27b87015cff0768138568a12e9c | [
"MIT"
] | 3 | 2020-05-04T03:43:20.000Z | 2020-12-03T22:34:47.000Z | kaori/plugins/gacha/engine/test/card_simulator.py | austinpray/kaori | b21c4146b9d0d27b87015cff0768138568a12e9c | [
"MIT"
] | 287 | 2020-04-21T02:39:47.000Z | 2022-03-28T13:11:59.000Z | kaori/plugins/gacha/engine/test/card_simulator.py | austinpray/kaori | b21c4146b9d0d27b87015cff0768138568a12e9c | [
"MIT"
] | 1 | 2020-10-22T00:20:43.000Z | 2020-10-22T00:20:43.000Z | from io import StringIO
import arrow
import mdv
from .cards import *
from .utils import collect_cards, card_markdown
from .. import *
from ..utils import trim_doc
def run_card_simulator(raw=False):
card_groups = {
'Baselines': [
hp_no_invest,
dmg_no_invest,
],
'HP... | 24.621212 | 101 | 0.564308 | from io import StringIO
import arrow
import mdv
from .cards import *
from .utils import collect_cards, card_markdown
from .. import *
from ..utils import trim_doc
def run_card_simulator(raw=False):
card_groups = {
'Baselines': [
hp_no_invest,
dmg_no_invest,
],
'HP... | true | true |
f7524cf05103b818a674e6a733553cc6b778a72d | 1,782 | py | Python | rgw/v2/lib/pem.py | rpratap-bot/ceph-qe-scripts | 8a7090d6707a8e7b927eabfc9c9212f343a35bc4 | [
"MIT"
] | null | null | null | rgw/v2/lib/pem.py | rpratap-bot/ceph-qe-scripts | 8a7090d6707a8e7b927eabfc9c9212f343a35bc4 | [
"MIT"
] | null | null | null | rgw/v2/lib/pem.py | rpratap-bot/ceph-qe-scripts | 8a7090d6707a8e7b927eabfc9c9212f343a35bc4 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, "../../../")))
import v2.utils.utils as utils
import traceback
SSL_CERT_PATH = '/etc/ssl/certs/'
PEM_FILE_NAME = 'server.pem'
PEM_FILE_PATH = os.path.join(SSL_CERT_PATH,
PEM_FILE_NAME)
import logging
log = loggi... | 30.724138 | 105 | 0.597643 | import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, "../../../")))
import v2.utils.utils as utils
import traceback
SSL_CERT_PATH = '/etc/ssl/certs/'
PEM_FILE_NAME = 'server.pem'
PEM_FILE_PATH = os.path.join(SSL_CERT_PATH,
PEM_FILE_NAME)
import logging
log = loggi... | true | true |
f7524d6b06d00fef03cb770ff38ecfd1a64170a3 | 699 | py | Python | tests/test_single_version.py | shadeofblue/single-version | 158ee876a2498cdd964fb2a5109ca93629744fa7 | [
"MIT"
] | null | null | null | tests/test_single_version.py | shadeofblue/single-version | 158ee876a2498cdd964fb2a5109ca93629744fa7 | [
"MIT"
] | null | null | null | tests/test_single_version.py | shadeofblue/single-version | 158ee876a2498cdd964fb2a5109ca93629744fa7 | [
"MIT"
] | null | null | null | from single_version import __version__
from single_version.ver import _REGEX_VERSION
def test_version():
assert __version__ == '1.2.2'
def test_version_regex():
assert _REGEX_VERSION.match('version="1.2"')
def test_version_regex_with_prefix():
assert _REGEX_VERSION.match('version="v1.2"')
def test_v... | 22.548387 | 60 | 0.756795 | from single_version import __version__
from single_version.ver import _REGEX_VERSION
def test_version():
assert __version__ == '1.2.2'
def test_version_regex():
assert _REGEX_VERSION.match('version="1.2"')
def test_version_regex_with_prefix():
assert _REGEX_VERSION.match('version="v1.2"')
def test_v... | true | true |
f7524ee7689a69ff9bf54d4f509e06b545f76709 | 1,346 | py | Python | 2018/day24/test_day24.py | kfarnung/advent-of-code | 74604578379c518bd7ad959e0088ca55a6986515 | [
"MIT"
] | 1 | 2017-12-11T07:08:52.000Z | 2017-12-11T07:08:52.000Z | 2018/day24/test_day24.py | kfarnung/advent-of-code | 74604578379c518bd7ad959e0088ca55a6986515 | [
"MIT"
] | 2 | 2020-12-01T08:16:42.000Z | 2021-05-12T04:54:34.000Z | 2018/day24/test_day24.py | kfarnung/advent-of-code | 74604578379c518bd7ad959e0088ca55a6986515 | [
"MIT"
] | null | null | null | """
Tests for Advent of Code Day 24.
https://adventofcode.com/2018/day/24
"""
from os import path
from .day24 import run_part1, run_part2
_CURRENT_FILE_DIR = path.dirname(__file__)
_TEST_DATA = [
'Immune System:',
'17 units each with 5390 hit points (weak to radiation, bludgeoning) with an attack that does '... | 32.047619 | 100 | 0.690193 |
from os import path
from .day24 import run_part1, run_part2
_CURRENT_FILE_DIR = path.dirname(__file__)
_TEST_DATA = [
'Immune System:',
'17 units each with 5390 hit points (weak to radiation, bludgeoning) with an attack that does '
'4507 fire damage at initiative 2',
'989 units each with 1274 hit poin... | true | true |
f7524f52f6d4abaa49ac183133af0ba7c9436807 | 7,149 | py | Python | tst/schedulers/test_hyperband.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 97 | 2021-11-18T17:14:30.000Z | 2022-03-29T00:33:12.000Z | tst/schedulers/test_hyperband.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 54 | 2021-11-18T17:14:12.000Z | 2022-03-22T08:11:48.000Z | tst/schedulers/test_hyperband.py | awslabs/syne-tune | 1dd8e157477b86db01047a9a7821780ea04389bc | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2021-11-29T11:47:32.000Z | 2022-02-24T15:28:11.000Z | # Copyright 2021 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | 37.234375 | 88 | 0.615471 |
from datetime import datetime
from typing import Optional, Dict, Tuple
import pytest
from syne_tune.optimizer.schedulers.hyperband import HyperbandScheduler
from syne_tune.config_space import randint, uniform
from syne_tune.backend.trial_status import Trial
from syne_tune.optimizer.scheduler import Schedul... | true | true |
f7525072026b529a7b05bf587945150f1aeb366e | 2,779 | py | Python | App/Set Tool Shortcuts.py | justanotherfoundry/Glyphs-Scripts | f28aeab0224ae19ace4a86cf363e7990985199b7 | [
"Apache-2.0"
] | 283 | 2015-01-07T12:35:35.000Z | 2022-03-29T06:10:44.000Z | App/Set Tool Shortcuts.py | justanotherfoundry/Glyphs-Scripts | f28aeab0224ae19ace4a86cf363e7990985199b7 | [
"Apache-2.0"
] | 203 | 2015-01-26T18:43:08.000Z | 2022-03-04T01:47:58.000Z | App/Set Tool Shortcuts.py | justanotherfoundry/Glyphs-Scripts | f28aeab0224ae19ace4a86cf363e7990985199b7 | [
"Apache-2.0"
] | 96 | 2015-01-19T20:58:03.000Z | 2022-03-29T06:10:56.000Z | #MenuTitle: Set Tool Shortcuts
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Set Shortcuts for tools in toolbar.
"""
import vanilla
shortcuts = {
"AnnotationTool": u"a",
"DrawTool": u"p",
"HandTool": u"h",
"MeasurementTool": u"l",
"OtherPathsTool": u"e",
"... | 31.942529 | 134 | 0.663908 |
from __future__ import division, print_function, unicode_literals
__doc__="""
Set Shortcuts for tools in toolbar.
"""
import vanilla
shortcuts = {
"AnnotationTool": u"a",
"DrawTool": u"p",
"HandTool": u"h",
"MeasurementTool": u"l",
"OtherPathsTool": u"e",
"PenTool": u"b",
"PrimitivesTool": u"f",
"SelectTool... | true | true |
f75252363f061c6d7b391aeddbf0cb5a203d69b0 | 667 | py | Python | example2/simple.py | Shuang0420/python-aiml | c92681a8458bbceb7efb5eab307f0b997c1bf8c8 | [
"BSD-2-Clause"
] | 73 | 2018-01-15T14:20:32.000Z | 2022-03-30T11:04:42.000Z | example2/simple.py | Shuang0420/python-aiml | c92681a8458bbceb7efb5eab307f0b997c1bf8c8 | [
"BSD-2-Clause"
] | null | null | null | example2/simple.py | Shuang0420/python-aiml | c92681a8458bbceb7efb5eab307f0b997c1bf8c8 | [
"BSD-2-Clause"
] | 32 | 2018-01-08T11:04:25.000Z | 2021-12-31T03:13:45.000Z |
import sys
sys.path.insert(0, "../")
import aiml
from aiml.constants import *
# The Kernel object is the public interface to
# the AIML interpreter.
k = aiml.Kernel()
# Use the 'learn' method to load the contents
# of an AIML file into the Kernel.
k.learn("cn-startup.xml")
# Use the 'respond' method to compute the... | 23 | 51 | 0.691154 |
import sys
sys.path.insert(0, "../")
import aiml
from aiml.constants import *
k = aiml.Kernel()
k.learn("cn-startup.xml")
# the interpreter's response, which in this case
k.respond("load aiml cnask")
while True:
if PY3:
print(k.respond(input("> ")))
else:
print(k.respond(raw_inpu... | true | true |
f75252c7a204123e93c0b9ad40729de4aae4a47b | 47 | py | Python | packages/girder_worker/girder_worker/plugins/types/format/image/png_base64_to_png.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | null | null | null | packages/girder_worker/girder_worker/plugins/types/format/image/png_base64_to_png.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | null | null | null | packages/girder_worker/girder_worker/plugins/types/format/image/png_base64_to_png.py | ShenQianwithC/HistomicsTK | 4ad7e72a7ebdabbdfc879254fad04ce7ca47e320 | [
"Apache-2.0"
] | null | null | null | import base64
output = base64.b64decode(input)
| 15.666667 | 32 | 0.808511 | import base64
output = base64.b64decode(input)
| true | true |
f75253983af5fae34eed957d055589cb30536f13 | 647 | py | Python | kittygram_plus/urls.py | IlushinGL/kittygram_plus | 0f4fd41d4b6295c3ecc2b373cfede2c77bd28319 | [
"MIT"
] | null | null | null | kittygram_plus/urls.py | IlushinGL/kittygram_plus | 0f4fd41d4b6295c3ecc2b373cfede2c77bd28319 | [
"MIT"
] | null | null | null | kittygram_plus/urls.py | IlushinGL/kittygram_plus | 0f4fd41d4b6295c3ecc2b373cfede2c77bd28319 | [
"MIT"
] | null | null | null | from rest_framework.routers import DefaultRouter
# from rest_framework.authtoken import views
from django.urls import include, path
from cats.views import CatViewSet, OwnerViewSet, LightCatViewSet
router = DefaultRouter()
router.register('cats', CatViewSet)
router.register('owners', OwnerViewSet)
router.register(r'm... | 30.809524 | 64 | 0.749614 | from rest_framework.routers import DefaultRouter
from django.urls import include, path
from cats.views import CatViewSet, OwnerViewSet, LightCatViewSet
router = DefaultRouter()
router.register('cats', CatViewSet)
router.register('owners', OwnerViewSet)
router.register(r'mycats', LightCatViewSet)
urlpatterns = [
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.