hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d69c538bee0142571d4579867231e6564e75be66 | 6,742 | py | Python | sampleapp/services.py | wardal/QuickBooksOAuth2CelerySampleApp | 9f6b4654e3996e0b75fcc95d10df112f51926165 | [
"Apache-2.0"
] | 1 | 2020-07-10T15:02:27.000Z | 2020-07-10T15:02:27.000Z | sampleapp/services.py | wardal/QuickBooksOAuth2CelerySampleApp | 9f6b4654e3996e0b75fcc95d10df112f51926165 | [
"Apache-2.0"
] | null | null | null | sampleapp/services.py | wardal/QuickBooksOAuth2CelerySampleApp | 9f6b4654e3996e0b75fcc95d10df112f51926165 | [
"Apache-2.0"
] | 1 | 2018-08-26T20:50:25.000Z | 2018-08-26T20:50:25.000Z | import requests
import base64
import json
import random
from jose import jwk
from datetime import datetime
from django.conf import settings
from sampleapp.models import Bearer, QuickBooksDiscoveryDocument
# token can either be an accessToken or a refreshToken
# The validation steps can be found at ours docs... | 37.043956 | 113 | 0.713438 | import requests
import base64
import json
import random
from jose import jwk
from datetime import datetime
from django.conf import settings
from sampleapp.models import Bearer, QuickBooksDiscoveryDocument
def get_discovery_document():
r = requests.get(settings.DISCOVERY_DOCUMENT)
if r.status_code >= 400:
... | 5,930 | 0 | 271 |
30500ae58b36dab9ac902322155ef133a3c4bfe5 | 373 | py | Python | Loop_Induced_Vertices/lorentz_ggZ.py | ycwu1030/2HDM_FR | 599490fd785cb67e3e4ffad1fa7536906ac8bcd5 | [
"MIT"
] | 1 | 2019-09-04T01:44:29.000Z | 2019-09-04T01:44:29.000Z | Loop_Induced_Vertices/lorentz_ggZ.py | ycwu1030/2HDM_FR | 599490fd785cb67e3e4ffad1fa7536906ac8bcd5 | [
"MIT"
] | null | null | null | Loop_Induced_Vertices/lorentz_ggZ.py | ycwu1030/2HDM_FR | 599490fd785cb67e3e4ffad1fa7536906ac8bcd5 | [
"MIT"
] | null | null | null |
VVVtop = Lorentz(name = 'VVVtop',
spins = [ 3, 3, 3 ],
structure = 'FTriZTop(2*P(-1,1)*P(-1,2)) * (Epsilon(1,2,-1,-2)*P(-1,1)*P(-2,2)*P(3,3))')
VVVbot = Lorentz(name = 'VVVbot',
spins = [ 3, 3, 3 ],
structure = 'FTriZBot(2*P(-1,1)*P(-1,2... | 31.083333 | 108 | 0.402145 |
VVVtop = Lorentz(name = 'VVVtop',
spins = [ 3, 3, 3 ],
structure = 'FTriZTop(2*P(-1,1)*P(-1,2)) * (Epsilon(1,2,-1,-2)*P(-1,1)*P(-2,2)*P(3,3))')
VVVbot = Lorentz(name = 'VVVbot',
spins = [ 3, 3, 3 ],
structure = 'FTriZBot(2*P(-1,1)*P(-1,2... | 0 | 0 | 0 |
10ff488f24fcfec2914a73fe8cba55da99fb8c61 | 8,155 | py | Python | tests/test_NHL.py | scrambldchannel/SportradarAPIs | e42e128313647d51784b6f1f3aa201b07fca0a08 | [
"MIT"
] | 33 | 2018-07-05T17:07:06.000Z | 2022-02-05T16:32:19.000Z | tests/test_NHL.py | scrambldchannel/SportradarAPIs | e42e128313647d51784b6f1f3aa201b07fca0a08 | [
"MIT"
] | 6 | 2018-11-16T15:53:33.000Z | 2021-06-26T23:04:33.000Z | tests/test_NHL.py | scrambldchannel/SportradarAPIs | e42e128313647d51784b6f1f3aa201b07fca0a08 | [
"MIT"
] | 17 | 2018-08-08T08:10:49.000Z | 2021-10-06T00:25:21.000Z | import os
import unittest
from sportradar import NHL
# Import API keys from environment variables
api_key_name = "SPORTRADAR_API_KEY_NHL"
api_key = os.environ.get(api_key_name, None)
assert api_key is not None, "Must declare environment variable: {key_name}".format(
key_name=api_key_name)
api = NHL.NHL(api_key, fo... | 43.37766 | 131 | 0.674433 | import os
import unittest
from sportradar import NHL
# Import API keys from environment variables
api_key_name = "SPORTRADAR_API_KEY_NHL"
api_key = os.environ.get(api_key_name, None)
assert api_key is not None, "Must declare environment variable: {key_name}".format(
key_name=api_key_name)
api = NHL.NHL(api_key, fo... | 585 | 7,185 | 23 |
2387e278d3aafd92b7dfe4b2ca45de0e1ef2480d | 5,111 | py | Python | tools/blink_rename_merge_helper/run.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/blink_rename_merge_helper/run.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/blink_rename_merge_helper/run.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tool to help developers rebase branches across the Blink rename."""
import argparse
import json
import os
import subprocess
import s... | 31.549383 | 80 | 0.710233 | #!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tool to help developers rebase branches across the Blink rename."""
import argparse
import json
import os
import subprocess
import s... | 1,324 | 460 | 121 |
b435fafce0a59f11f645388807ab94a4c526348c | 3,300 | py | Python | ai_chickenpoker/python/echo_bot.py | hilkoc/AI_Arena | 592be09062a4cf02f2b153e3c2e5afc7ca15d084 | [
"MIT"
] | 35 | 2017-05-29T04:25:20.000Z | 2021-10-03T22:43:57.000Z | ai_chickenpoker/python/echo_bot.py | hilkoc/AI_Arena | 592be09062a4cf02f2b153e3c2e5afc7ca15d084 | [
"MIT"
] | null | null | null | ai_chickenpoker/python/echo_bot.py | hilkoc/AI_Arena | 592be09062a4cf02f2b153e3c2e5afc7ca15d084 | [
"MIT"
] | 1 | 2019-03-05T03:38:17.000Z | 2019-03-05T03:38:17.000Z | """ Chicken Poker echo bot. """
import logging
logging.basicConfig(filename='echo_bot.log', level=logging.WARN, filemode='w', format='%(levelname)s %(message)s')
log = logging.getLogger(__name__)
log.info("Starting")
#
# Networking
#
import sys
def deserialize_round(round_string):
""" param: round_string is e... | 25.984252 | 114 | 0.588485 | """ Chicken Poker echo bot. """
import logging
logging.basicConfig(filename='echo_bot.log', level=logging.WARN, filemode='w', format='%(levelname)s %(message)s')
log = logging.getLogger(__name__)
log.info("Starting")
#
# Networking
#
import sys
def deserialize_round(round_string):
""" param: round_string is e... | 1,093 | 1,198 | 184 |
7134af531e2e0820e6645888186d7ca8871d70c0 | 537 | py | Python | api/test/checkalive_api.py | kizunai/flask-server | 79f1484e776c74f23ef22836c5a0970ef66ecdfb | [
"Apache-2.0"
] | null | null | null | api/test/checkalive_api.py | kizunai/flask-server | 79f1484e776c74f23ef22836c5a0970ef66ecdfb | [
"Apache-2.0"
] | null | null | null | api/test/checkalive_api.py | kizunai/flask-server | 79f1484e776c74f23ef22836c5a0970ef66ecdfb | [
"Apache-2.0"
] | null | null | null | import flask
from flask_restful import Resource
from utils import decoraters
from logic.test.checkalive_logic import CheckaliveLogic
class CheckaliveApi(Resource):
"""CheckaliveApi
/api/checkalive
"""
@decoraters.response_format
def get(self):
"""
"""
checkalive_logic = Ch... | 22.375 | 55 | 0.648045 | import flask
from flask_restful import Resource
from utils import decoraters
from logic.test.checkalive_logic import CheckaliveLogic
class CheckaliveApi(Resource):
"""CheckaliveApi
/api/checkalive
"""
def __init__(self):
self.log_id = 1 #todo 暂时用1代替
@decoraters.response_format
def ge... | 45 | 0 | 27 |
f77b93c5d335f1a4a405c53278cc536a56724859 | 2,061 | py | Python | source/random_walk.py | xalhs/Random-Walks | 106f972e2b9c204039ba4ae0e39ccdec4165e656 | [
"MIT"
] | null | null | null | source/random_walk.py | xalhs/Random-Walks | 106f972e2b9c204039ba4ae0e39ccdec4165e656 | [
"MIT"
] | null | null | null | source/random_walk.py | xalhs/Random-Walks | 106f972e2b9c204039ba4ae0e39ccdec4165e656 | [
"MIT"
] | null | null | null | import random
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
tmax = 875
t = 0
x = [0]
y = [0]
t=0
t_total = 0
dist = 0
#coord = [[x[t],y[t]]]
while t < tmax:
coord = random.randint(0,1)
if coord == 0:
direction = random.randint(0,1)
dire... | 21.030612 | 81 | 0.59049 | import random
import math
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
tmax = 875
t = 0
x = [0]
y = [0]
t=0
t_total = 0
dist = 0
#coord = [[x[t],y[t]]]
while t < tmax:
coord = random.randint(0,1)
if coord == 0:
direction = random.randint(0,1)
dire... | 803 | 0 | 46 |
85f03a24d0a65614f8a9c4cb85b5e316e4f2acd6 | 1,048 | py | Python | api/user_role/set_own_role.py | BernarBerdikul/Auth_sprint_2 | 9286803f7e073456b2f02f2072072773331b9e5b | [
"BSD-3-Clause"
] | null | null | null | api/user_role/set_own_role.py | BernarBerdikul/Auth_sprint_2 | 9286803f7e073456b2f02f2072072773331b9e5b | [
"BSD-3-Clause"
] | null | null | null | api/user_role/set_own_role.py | BernarBerdikul/Auth_sprint_2 | 9286803f7e073456b2f02f2072072773331b9e5b | [
"BSD-3-Clause"
] | null | null | null | import http
from flask_jwt_extended import get_jwt_identity, jwt_required
from flask_restful import Resource, reqparse
from core import config
from models import UserRole
from utils.decorators import api_response_wrapper
from utils.rate_limit import rate_limit
parser = reqparse.RequestParser()
parser.add_argument(
... | 30.823529 | 75 | 0.694656 | import http
from flask_jwt_extended import get_jwt_identity, jwt_required
from flask_restful import Resource, reqparse
from core import config
from models import UserRole
from utils.decorators import api_response_wrapper
from utils.rate_limit import rate_limit
parser = reqparse.RequestParser()
parser.add_argument(
... | 449 | 0 | 26 |
ebfd2a332e25c8c2417af2099741c136ec0e9a4e | 152 | py | Python | webapi.py | zhulinhai/pyLearn | 664f03cad26b540f83e64f278adf60316efb81d9 | [
"MIT"
] | null | null | null | webapi.py | zhulinhai/pyLearn | 664f03cad26b540f83e64f278adf60316efb81d9 | [
"MIT"
] | null | null | null | webapi.py | zhulinhai/pyLearn | 664f03cad26b540f83e64f278adf60316efb81d9 | [
"MIT"
] | null | null | null |
import requests
url = 'https://api.github.com/repos/pandas-dev/pandas/issues'
resp = requests.get(url)
data = resp.json()
print(data[0].avatar_url)
| 15.2 | 61 | 0.723684 |
import requests
url = 'https://api.github.com/repos/pandas-dev/pandas/issues'
resp = requests.get(url)
data = resp.json()
print(data[0].avatar_url)
| 0 | 0 | 0 |
7154e16c3999421ff4b80119756b08135533b62a | 250 | py | Python | actions/toggle_fullscreen.py | matteobarbieri/libtcod-tutorial | 2be59978483d1c754b736a0fe96c9554e9ba8547 | [
"MIT"
] | 1 | 2019-03-09T14:20:51.000Z | 2019-03-09T14:20:51.000Z | actions/toggle_fullscreen.py | matteobarbieri/libtcod-tutorial | 2be59978483d1c754b736a0fe96c9554e9ba8547 | [
"MIT"
] | null | null | null | actions/toggle_fullscreen.py | matteobarbieri/libtcod-tutorial | 2be59978483d1c754b736a0fe96c9554e9ba8547 | [
"MIT"
] | null | null | null | from .action import Action
import libtcodpy as libtcod
# def __init__(self, **kwargs):
# pass
| 17.857143 | 75 | 0.716 | from .action import Action
import libtcodpy as libtcod
class ToggleFullscreenAction(Action):
# def __init__(self, **kwargs):
# pass
def _execute(self):
libtcod.console_set_fullscreen(not libtcod.console_is_fullscreen())
| 75 | 16 | 50 |
8b3d19de2881cc4f8fb5289b7e96d859fd39def1 | 942 | py | Python | cowsay_app/views.py | JustDeWitt8485/django-cowsay | 4c3cf91eb7ba394cd7fd581b3d86c56494acf413 | [
"MIT"
] | null | null | null | cowsay_app/views.py | JustDeWitt8485/django-cowsay | 4c3cf91eb7ba394cd7fd581b3d86c56494acf413 | [
"MIT"
] | null | null | null | cowsay_app/views.py | JustDeWitt8485/django-cowsay | 4c3cf91eb7ba394cd7fd581b3d86c56494acf413 | [
"MIT"
] | null | null | null | import subprocess
from django.shortcuts import render
from cowsay_app.form import AddMessageForm
from cowsay_app.models import Message
# Create your views here.
| 26.914286 | 68 | 0.617834 | import subprocess
from django.shortcuts import render
from cowsay_app.form import AddMessageForm
from cowsay_app.models import Message
# Create your views here.
def index(request, ):
html = 'index.html'
if request.method == 'POST':
form = AddMessageForm(request.POST)
if form.is_valid():
... | 729 | 0 | 46 |
f5d3cb80bd255f8613159fc984f33c55005a57e1 | 495 | py | Python | deba/commands/targets.py | pckhoi/liner | d07f86806902de77d0acc42301ae3dd1b93450d5 | [
"MIT"
] | null | null | null | deba/commands/targets.py | pckhoi/liner | d07f86806902de77d0acc42301ae3dd1b93450d5 | [
"MIT"
] | null | null | null | deba/commands/targets.py | pckhoi/liner | d07f86806902de77d0acc42301ae3dd1b93450d5 | [
"MIT"
] | null | null | null | import argparse
import os
from deba.commands.decorators import subcommand
from deba.config import Config
@subcommand(exec=exec)
| 23.571429 | 72 | 0.737374 | import argparse
import os
from deba.commands.decorators import subcommand
from deba.config import Config
def exec(conf: Config, args: argparse.Namespace):
if conf.targets is None:
return
for target in conf.targets:
print(os.path.join(conf.data_dir, target))
@subcommand(exec=exec)
def add_su... | 318 | 0 | 45 |
55d14eff6398db53818deab7c18611e64b7586a5 | 218 | py | Python | translation/admin.py | paxenarius/ajiragis-api | 414ed05b8218cf116474889a9fb959e98e48ddad | [
"MIT"
] | null | null | null | translation/admin.py | paxenarius/ajiragis-api | 414ed05b8218cf116474889a9fb959e98e48ddad | [
"MIT"
] | 1 | 2018-07-21T08:58:10.000Z | 2018-07-21T08:58:10.000Z | translation/admin.py | paxenarius/ajiragis-api | 414ed05b8218cf116474889a9fb959e98e48ddad | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Translation, Language, Word, Language, Payment
admin.site.register(Translation)
admin.site.register(Language)
admin.site.register(Word)
admin.site.register(Payment) | 31.142857 | 66 | 0.825688 | from django.contrib import admin
from .models import Translation, Language, Word, Language, Payment
admin.site.register(Translation)
admin.site.register(Language)
admin.site.register(Word)
admin.site.register(Payment) | 0 | 0 | 0 |
b583fa123004bcc2e6695f2a2d01549f2f233114 | 1,652 | py | Python | bgan_util.py | RhFeng/BGANs | 21b01b3cfb34dd4397ad89724cee629ba44cdb9f | [
"MIT"
] | null | null | null | bgan_util.py | RhFeng/BGANs | 21b01b3cfb34dd4397ad89724cee629ba44cdb9f | [
"MIT"
] | null | null | null | bgan_util.py | RhFeng/BGANs | 21b01b3cfb34dd4397ad89724cee629ba44cdb9f | [
"MIT"
] | null | null | null | import os
import glob
import numpy as np
import six
import pickle as cPickle
import tensorflow as tf
from imageio import imread
import scipy.io as sio
| 28.982456 | 86 | 0.654358 | import os
import glob
import numpy as np
import six
import pickle as cPickle
import tensorflow as tf
from imageio import imread
import scipy.io as sio
def one_hot_encoded(class_numbers, num_classes):
return np.eye(num_classes, dtype=float)[class_numbers]
class AttributeDict(dict):
def __getattr__(self, ... | 1,020 | 315 | 155 |
07aca9a7b77fb6b4daa367123f2ce2277b78f4a4 | 1,523 | py | Python | 3. Numbers/numbers-python-V2.py | guruawate/PYTHON-CODEBASE | 1a8eff9e81a49a2fc3ca99d26588c15a97cbe379 | [
"MIT"
] | 4 | 2017-03-29T17:03:22.000Z | 2018-10-17T11:50:43.000Z | 3. Numbers/numbers-python-V2.py | guruawate/PYTHON-CODEBASE | 1a8eff9e81a49a2fc3ca99d26588c15a97cbe379 | [
"MIT"
] | null | null | null | 3. Numbers/numbers-python-V2.py | guruawate/PYTHON-CODEBASE | 1a8eff9e81a49a2fc3ca99d26588c15a97cbe379 | [
"MIT"
] | 2 | 2017-09-13T18:17:22.000Z | 2018-10-17T11:50:44.000Z | message = """\n\nThere are 4 types of numbers in python-2 & 3 types of numbers in python-3
Now we will see python-2 numbers which are of 4 types,
namely: int, long, float & complex.
ints & longs are whole numbers and floats are rea... | 27.196429 | 123 | 0.631648 | message = """\n\nThere are 4 types of numbers in python-2 & 3 types of numbers in python-3
Now we will see python-2 numbers which are of 4 types,
namely: int, long, float & complex.
ints & longs are whole numbers and floats are rea... | 0 | 0 | 0 |
35e72bb7def870ccf8993c022721c1f933cfb65f | 971 | py | Python | OpenScope/FixModel.py | openscope/qgsopenscope | 123926cb2e67abc90070da85407fa54e7cbd66eb | [
"MIT"
] | 2 | 2020-01-23T12:09:59.000Z | 2021-03-23T18:20:56.000Z | OpenScope/FixModel.py | openscope/qgsopenscope | 123926cb2e67abc90070da85407fa54e7cbd66eb | [
"MIT"
] | 1 | 2021-02-25T09:44:01.000Z | 2021-04-07T14:39:23.000Z | OpenScope/FixModel.py | openscope/qgsopenscope | 123926cb2e67abc90070da85407fa54e7cbd66eb | [
"MIT"
] | null | null | null | """An opeScope Fix object"""
import json
from .utilities.converters import fromPointXY, toPointXY
class FixModel:
"""An opeScope Fix object"""
location = None
name = None
@staticmethod
def export(layer):
"""Export the specified QgsMapLayer features to JSON"""
lines = []
... | 26.243243 | 88 | 0.548919 | """An opeScope Fix object"""
import json
from .utilities.converters import fromPointXY, toPointXY
class FixModel:
"""An opeScope Fix object"""
location = None
name = None
def __init__(self, name, location):
self.location = toPointXY(location)
self.name = name
@staticmethod
d... | 83 | 0 | 27 |
30c2dd8de48cfd0967d2d2b4f061fe5c560cc12e | 633 | py | Python | pkg/protocols/__init__.py | aivazis/qed | d8717ea807e956beb8b1c59e51c45c672bb7d05e | [
"BSD-2-Clause"
] | 6 | 2022-03-07T17:47:28.000Z | 2022-03-19T05:16:25.000Z | pkg/protocols/__init__.py | aivazis/qed | d8717ea807e956beb8b1c59e51c45c672bb7d05e | [
"BSD-2-Clause"
] | 4 | 2022-03-17T01:54:42.000Z | 2022-03-19T05:17:33.000Z | pkg/protocols/__init__.py | aivazis/qed | d8717ea807e956beb8b1c59e51c45c672bb7d05e | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
# custom properties
from .properties import selectors
# export the local wrappers over the flow protocols
from .Producer import Producer as producer
from .Specification import Specification as specifi... | 23.444444 | 57 | 0.78515 | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
# custom properties
from .properties import selectors
# export the local wrappers over the flow protocols
from .Producer import Producer as producer
from .Specification import Specification as specifi... | 0 | 0 | 0 |
427492e28b4fdd182f6ddfab4fe02ea50d20eebd | 3,152 | py | Python | src/export_to_spotify_playlist.py | PinPinIre/slack-scripts | 4a86b949ee37aab821684f596b8230316c32aebe | [
"MIT"
] | null | null | null | src/export_to_spotify_playlist.py | PinPinIre/slack-scripts | 4a86b949ee37aab821684f596b8230316c32aebe | [
"MIT"
] | 2 | 2021-02-08T20:17:56.000Z | 2021-04-30T20:34:30.000Z | src/export_to_spotify_playlist.py | PinPinIre/slack-scripts | 4a86b949ee37aab821684f596b8230316c32aebe | [
"MIT"
] | null | null | null | import sys
import os
import json
import argparse
import re
from urlparse import urlparse, parse_qs
from datetime import datetime
from elasticsearch import Elasticsearch, ElasticsearchException
from elasticsearch_dsl import Search
from spotify_wrapper import SpotifyWrapper
TRACK_REGEX = 'track.'
SONG_ID_LENGTH = 22
#... | 31.207921 | 88 | 0.725888 | import sys
import os
import json
import argparse
import re
from urlparse import urlparse, parse_qs
from datetime import datetime
from elasticsearch import Elasticsearch, ElasticsearchException
from elasticsearch_dsl import Search
from spotify_wrapper import SpotifyWrapper
TRACK_REGEX = 'track.'
SONG_ID_LENGTH = 22
#... | 693 | 0 | 23 |
f3898c00018381c75d7be14ca8f07404b750f6f3 | 1,755 | py | Python | fastNLP/models/cnn_text_classification.py | YanLiqi/fastNLP | a8c45796158a3b8dbc81e22412bd6e4e4b97539a | [
"Apache-2.0"
] | 4 | 2019-01-19T13:58:10.000Z | 2019-01-19T15:07:48.000Z | fastNLP/models/cnn_text_classification.py | TTTREE/fastNLP | ef82c1f10000752db32a5fa323668b94bcb940a1 | [
"Apache-2.0"
] | 1 | 2018-09-30T13:30:51.000Z | 2018-09-30T13:30:51.000Z | fastNLP/models/cnn_text_classification.py | TTTREE/fastNLP | ef82c1f10000752db32a5fa323668b94bcb940a1 | [
"Apache-2.0"
] | null | null | null | # python: 3.6
# encoding: utf-8
import torch
import torch.nn as nn
# import torch.nn.functional as F
import fastNLP.modules.encoder as encoder
class CNNText(torch.nn.Module):
"""
Text classification model by character CNN, the implementation of paper
'Yoon Kim. 2014. Convolution Neural Networks for Sent... | 30.258621 | 75 | 0.581766 | # python: 3.6
# encoding: utf-8
import torch
import torch.nn as nn
# import torch.nn.functional as F
import fastNLP.modules.encoder as encoder
class CNNText(torch.nn.Module):
"""
Text classification model by character CNN, the implementation of paper
'Yoon Kim. 2014. Convolution Neural Networks for Sent... | 659 | 0 | 27 |
cb698090622fd1b43ebe65c67378ddf0b2c50449 | 269 | py | Python | src/swarm_rescue/spg_overlay/misc_data.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | 1 | 2021-11-15T23:35:29.000Z | 2021-11-15T23:35:29.000Z | src/swarm_rescue/spg_overlay/misc_data.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | null | null | null | src/swarm_rescue/spg_overlay/misc_data.py | filliat/swarm-rescue | ce323c90ccb4a25216c63abccd09d3f31eea1189 | [
"MIT"
] | 1 | 2021-12-13T16:11:47.000Z | 2021-12-13T16:11:47.000Z | from typing import Tuple
class MiscData:
"""
This class should be used to contains miscellaneous data for the drone
"""
| 20.692308 | 74 | 0.587361 | from typing import Tuple
class MiscData:
"""
This class should be used to contains miscellaneous data for the drone
"""
def __init__(self,
size_area: Tuple[float, float] = None,
):
self.size_area = size_area
| 108 | 0 | 27 |
ac64b077757bdbefdd1d8a6aca3f26b70d545ea9 | 932 | py | Python | test/selfTest.py | repo-satish/bruteforce | 866b2d16f93c2eb121dad9f2a7b13988883bbc7a | [
"Unlicense"
] | 1 | 2016-03-15T14:18:01.000Z | 2016-03-15T14:18:01.000Z | test/selfTest.py | repo-satish/bruteforce | 866b2d16f93c2eb121dad9f2a7b13988883bbc7a | [
"Unlicense"
] | null | null | null | test/selfTest.py | repo-satish/bruteforce | 866b2d16f93c2eb121dad9f2a7b13988883bbc7a | [
"Unlicense"
] | null | null | null | """
PUORPOSE:
to check that the brute-force machine with all its components is actually
working - i.e. when the algorithms used for padding, key derivation and
encryption are known CORRECTLY
"""
from raw import img
from breaker import breaker, init
import os
import base64
import tempfile
| 20.26087 | 74 | 0.703863 | """
PUORPOSE:
to check that the brute-force machine with all its components is actually
working - i.e. when the algorithms used for padding, key derivation and
encryption are known CORRECTLY
"""
from raw import img
from breaker import breaker, init
import os
import base64
import tempfile
def createTestImages():
... | 544 | 0 | 93 |
7908caa4c581577ad0c130e7ce6fab5638920619 | 3,685 | py | Python | pygimli/viewer/mpl/matrixview.py | JuliusHen/gimli | a5c5779261acfe5a53015c9ee6f7c9ed2dd6c57f | [
"Apache-2.0"
] | 224 | 2015-02-20T21:36:24.000Z | 2022-03-30T07:27:43.000Z | pygimli/viewer/mpl/matrixview.py | JuliusHen/gimli | a5c5779261acfe5a53015c9ee6f7c9ed2dd6c57f | [
"Apache-2.0"
] | 341 | 2015-05-21T14:39:51.000Z | 2022-03-31T01:54:07.000Z | pygimli/viewer/mpl/matrixview.py | JuliusHen/gimli | a5c5779261acfe5a53015c9ee6f7c9ed2dd6c57f | [
"Apache-2.0"
] | 107 | 2015-01-24T14:40:21.000Z | 2022-02-25T12:12:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functions to draw various pygimli matrices with matplotlib."""
import numpy as np
import matplotlib.pyplot as plt
import pygimli as pg
def drawSparseMatrix(ax, mat, **kwargs):
"""Draw a view of a matrix into the axes.
Parameters
----------
ax : mpl a... | 28.789063 | 110 | 0.538128 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Functions to draw various pygimli matrices with matplotlib."""
import numpy as np
import matplotlib.pyplot as plt
import pygimli as pg
def drawSparseMatrix(ax, mat, **kwargs):
"""Draw a view of a matrix into the axes.
Parameters
----------
ax : mpl a... | 0 | 0 | 0 |
e9e6eb2656bb47805079103416164d651126377a | 4,287 | py | Python | LOBDeepPP/LOBDeepPP_model/__LOB_models_features.py | mariussterling/LOBDeepPP_code | 010782f8db9a745940753f49d953361c32ee1190 | [
"MIT"
] | 1 | 2021-07-09T08:40:58.000Z | 2021-07-09T08:40:58.000Z | LOBDeepPP/LOBDeepPP_model/__LOB_models_features.py | mariussterling/LOBDeepPP_code | 010782f8db9a745940753f49d953361c32ee1190 | [
"MIT"
] | null | null | null | LOBDeepPP/LOBDeepPP_model/__LOB_models_features.py | mariussterling/LOBDeepPP_code | 010782f8db9a745940753f49d953361c32ee1190 | [
"MIT"
] | null | null | null | from keras import layers, models
from .__inception import inception2D
bn_axis = -1
| 38.276786 | 78 | 0.594122 | from keras import layers, models
from .__inception import inception2D
bn_axis = -1
def fe0a(input, params, interpretable, L):
if interpretable:
out = input
else:
inp = layers.InputLayer(input_shape=input.get_shape().as_list()[1:],
name='inp0')
out = inp... | 4,155 | 0 | 46 |
fcdfc76d75f854a3177bb5a898d978ec5363e47c | 155 | py | Python | egocom/__init__.py | cgnorthcutt/EgoCom-Dataset | 4f17ea5447e6990071dbab4936cc3e713551a3f4 | [
"MIT"
] | 36 | 2020-11-05T20:30:18.000Z | 2021-12-07T04:35:35.000Z | egocom/__init__.py | cgnorthcutt/EgoCom-Dataset | 4f17ea5447e6990071dbab4936cc3e713551a3f4 | [
"MIT"
] | 2 | 2020-11-07T21:39:41.000Z | 2020-11-07T21:45:06.000Z | egocom/__init__.py | cgnorthcutt/EgoCom-Dataset | 4f17ea5447e6990071dbab4936cc3e713551a3f4 | [
"MIT"
] | 5 | 2020-11-07T20:46:15.000Z | 2021-11-06T14:05:46.000Z | from .version import __version__
from . import audio
from . import multi_array_alignment
from . import transcription
from . import word_error_rate_analysis | 31 | 38 | 0.845161 | from .version import __version__
from . import audio
from . import multi_array_alignment
from . import transcription
from . import word_error_rate_analysis | 0 | 0 | 0 |
86e5e9fe87956f3f8111e302dc2686117461682e | 2,230 | py | Python | smoke/features/steps/command.py | nhojpatrick/openshift_jenkins | 755cd527dcd330cc1950453d551db83715f1431e | [
"Apache-2.0"
] | 267 | 2015-09-07T21:44:43.000Z | 2022-03-30T08:09:31.000Z | smoke/features/steps/command.py | nhojpatrick/openshift_jenkins | 755cd527dcd330cc1950453d551db83715f1431e | [
"Apache-2.0"
] | 1,367 | 2015-07-13T19:21:01.000Z | 2022-03-31T21:05:34.000Z | smoke/features/steps/command.py | nhojpatrick/openshift_jenkins | 755cd527dcd330cc1950453d551db83715f1431e | [
"Apache-2.0"
] | 517 | 2015-07-15T08:21:12.000Z | 2022-03-30T08:09:32.000Z | import subprocess
import time
import os
| 37.79661 | 149 | 0.610762 | import subprocess
import time
import os
class Command(object):
path = ""
env = {}
def __init__(self, path=None):
if path is None:
self.path = os.getcwd()
else:
self.path = path
kubeconfig = os.getenv("KUBECONFIG")
assert kubeconfig is not None, "KUB... | 2,004 | 163 | 23 |
b570e830c494da6792afd0b784b6b34c6e1c0a6d | 8,148 | py | Python | shapeworld/captioners/relation.py | shgoren/ShapeWorld | a6633bddbf195d0dc4cbdbe07564a98149337bcf | [
"MIT"
] | 1 | 2021-04-08T16:14:25.000Z | 2021-04-08T16:14:25.000Z | shapeworld/captioners/relation.py | shgoren/ShapeWorld | a6633bddbf195d0dc4cbdbe07564a98149337bcf | [
"MIT"
] | null | null | null | shapeworld/captioners/relation.py | shgoren/ShapeWorld | a6633bddbf195d0dc4cbdbe07564a98149337bcf | [
"MIT"
] | 1 | 2021-02-23T17:10:46.000Z | 2021-02-23T17:10:46.000Z | from random import choice
from shapeworld import util
from shapeworld.captions import Relation
from shapeworld.captioners import WorldCaptioner
# incorrect modes
# 0: correct
# 1: incorrect reference
# 2: incorrect comparison
# 3: incorrect relation
# 4: inverse relation
| 49.682927 | 270 | 0.702995 | from random import choice
from shapeworld import util
from shapeworld.captions import Relation
from shapeworld.captioners import WorldCaptioner
class RelationCaptioner(WorldCaptioner):
# incorrect modes
# 0: correct
# 1: incorrect reference
# 2: incorrect comparison
# 3: incorrect relation
# ... | 7,565 | 19 | 266 |
34b147880807934392a4bdd919ed1af2d4097a0c | 5,135 | py | Python | tests/test_cursor.py | whalebot-helmsman/pykt-64 | ee5e0413cd850876d3abc438480fffea4f7b7517 | [
"BSD-3-Clause"
] | null | null | null | tests/test_cursor.py | whalebot-helmsman/pykt-64 | ee5e0413cd850876d3abc438480fffea4f7b7517 | [
"BSD-3-Clause"
] | null | null | null | tests/test_cursor.py | whalebot-helmsman/pykt-64 | ee5e0413cd850876d3abc438480fffea4f7b7517 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from setup_teardown import clear, stop_db
from nose.tools import *
from pykt import KyotoTycoon, KTException, Cursor
import time
d = dict(A="B", C="D", E="F", G="H")
d2 = {
"あいうえお": "ABC",
"かきくけこ": "てすと2",
"さしすせそ": "てすと2",
}
@nottest
@raises(IOError)
@with_setup(setup = clear... | 20.376984 | 49 | 0.534372 | # -*- coding: utf-8 -*-
from setup_teardown import clear, stop_db
from nose.tools import *
from pykt import KyotoTycoon, KTException, Cursor
import time
d = dict(A="B", C="D", E="F", G="H")
d2 = {
"あいうえお": "ABC",
"かきくけこ": "てすと2",
"さしすせそ": "てすと2",
}
@nottest
@raises(IOError)
def test_cursor_err():
... | 3,376 | 0 | 374 |
f62eab45f79915cc14c7c0def321d3e6ec0d6c54 | 3,667 | py | Python | integrations/tensorflow/e2e/conv_transpose_test.py | metagraph-dev/iree | 3d6acd1c47072fdf4cfab842807f70b1c2d34396 | [
"Apache-2.0"
] | 2 | 2021-10-03T15:58:09.000Z | 2021-11-17T10:34:35.000Z | integrations/tensorflow/e2e/conv_transpose_test.py | metagraph-dev/iree | 3d6acd1c47072fdf4cfab842807f70b1c2d34396 | [
"Apache-2.0"
] | null | null | null | integrations/tensorflow/e2e/conv_transpose_test.py | metagraph-dev/iree | 3d6acd1c47072fdf4cfab842807f70b1c2d34396 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.451327 | 74 | 0.595037 | # Lint as: python3
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 2,136 | 526 | 168 |
0e8527be56b7c736e3b98cb600e706392c084af0 | 519 | py | Python | sender.py | JimmyLiang-lzm/TimeForSchool | e38e04865e6c154b2f655681e93aa1bb85fc5e87 | [
"BSD-3-Clause"
] | 3 | 2020-04-08T04:05:50.000Z | 2020-04-09T02:09:39.000Z | sender.py | JimmyLiang-lzm/TimeForSchool | e38e04865e6c154b2f655681e93aa1bb85fc5e87 | [
"BSD-3-Clause"
] | null | null | null | sender.py | JimmyLiang-lzm/TimeForSchool | e38e04865e6c154b2f655681e93aa1bb85fc5e87 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:utf-8 -*-
#__Author__:"JimmyLiang"
#__Date__: 2020/4/7
from twilio.rest import Client
import re | 32.4375 | 93 | 0.689788 | # -*-coding:utf-8 -*-
#__Author__:"JimmyLiang"
#__Date__: 2020/4/7
from twilio.rest import Client
import re
def SendMessage(phonenum,messages): #此为短信发送设置,请登录twilio获取XXXX与0000部分
res = re.match(r'^1[35789]\d{9}$',phonenum)
if res:
account_sid = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = ... | 422 | 0 | 23 |
18a873aa2beb7251322efbd6f08ddc0360ff07dc | 524 | py | Python | build.py | dendisuhubdy/tgbot-cpp | 89ec4e3d1186e1a250adb18cb6a8cce7c4756bf6 | [
"MIT"
] | 1 | 2020-07-03T20:09:30.000Z | 2020-07-03T20:09:30.000Z | build.py | dendisuhubdy/tgbot-cpp | 89ec4e3d1186e1a250adb18cb6a8cce7c4756bf6 | [
"MIT"
] | null | null | null | build.py | dendisuhubdy/tgbot-cpp | 89ec4e3d1186e1a250adb18cb6a8cce7c4756bf6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from cpt.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager(
username="reo7sp",
login_username="reo7sp",
upload="https://api.bintray.com/conan/reo7sp/tgbot-cpp",
channel="ci",
stable_bran... | 29.111111 | 93 | 0.65458 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from cpt.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager(
username="reo7sp",
login_username="reo7sp",
upload="https://api.bintray.com/conan/reo7sp/tgbot-cpp",
channel="ci",
stable_bran... | 0 | 0 | 0 |
ae6cdb75673eee70553b1036a90e74e193c2c5f3 | 4,896 | py | Python | tests/strategies/literals.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 7 | 2020-05-07T08:13:44.000Z | 2021-12-17T07:33:51.000Z | tests/strategies/literals.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 17 | 2019-11-29T23:17:26.000Z | 2020-12-20T15:47:17.000Z | tests/strategies/literals.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 1 | 2020-12-17T22:44:21.000Z | 2020-12-17T22:44:21.000Z | import sys
from decimal import Decimal
from fractions import Fraction
from functools import partial
from typing import (Optional,
SupportsFloat)
from hypothesis import strategies
from martinez.hints import Scalar
from tests.utils import (MAX_VALUE,
MIN_VALUE,
... | 40.131148 | 79 | 0.618464 | import sys
from decimal import Decimal
from fractions import Fraction
from functools import partial
from typing import (Optional,
SupportsFloat)
from hypothesis import strategies
from martinez.hints import Scalar
from tests.utils import (MAX_VALUE,
MIN_VALUE,
... | 3,418 | 0 | 138 |
5942bedf735f04bd1f260b26548f7ad0b5927012 | 898 | py | Python | tests/mock/gpio_checks_isr.py | jontrulson/mraa | d7ae17171bd733291aca70f910a0c2618fa4fe1a | [
"MIT"
] | 1,167 | 2015-01-01T08:59:59.000Z | 2019-12-16T03:23:42.000Z | tests/mock/gpio_checks_isr.py | jontrulson/mraa | d7ae17171bd733291aca70f910a0c2618fa4fe1a | [
"MIT"
] | 889 | 2015-01-02T11:44:45.000Z | 2019-12-09T09:28:57.000Z | tests/mock/gpio_checks_isr.py | jontrulson/mraa | d7ae17171bd733291aca70f910a0c2618fa4fe1a | [
"MIT"
] | 634 | 2015-01-01T03:01:05.000Z | 2019-12-17T04:01:39.000Z | #!/usr/bin/env python
# Author: Alex Tereschenko <alext.mkrs@gmail.com>
# Copyright (c) 2016 Alex Tereschenko <alext.mkrs@gmail.com>
#
# SPDX-License-Identifier: MIT
import mraa as m
import unittest as u
MRAA_TEST_PIN = 0
if __name__ == '__main__':
u.main()
| 24.944444 | 110 | 0.702673 | #!/usr/bin/env python
# Author: Alex Tereschenko <alext.mkrs@gmail.com>
# Copyright (c) 2016 Alex Tereschenko <alext.mkrs@gmail.com>
#
# SPDX-License-Identifier: MIT
import mraa as m
import unittest as u
MRAA_TEST_PIN = 0
def test_isr():
print("In the ISR")
class GpioChecksIsr(u.TestCase):
def setUp(self):
... | 478 | 11 | 145 |
7a8a134b272ca88d650d2bbb621d49b76ccbfb08 | 330 | py | Python | bohr/formatting.py | giganticode/bohr-framework | fd364a1f036123985ac96e9076e5dce3bbc2ca2c | [
"MIT"
] | null | null | null | bohr/formatting.py | giganticode/bohr-framework | fd364a1f036123985ac96e9076e5dce3bbc2ca2c | [
"MIT"
] | 54 | 2021-02-17T13:36:51.000Z | 2021-08-25T05:06:57.000Z | bohrruntime/formatting.py | giganticode/bohr-runtime | 9af22c01f07dcb93598b9632161f0e9a7d84efcf | [
"MIT"
] | null | null | null | import pandas as pd
from tabulate import tabulate
| 22 | 53 | 0.587879 | import pandas as pd
from tabulate import tabulate
def tabulate_artifacts(df: pd.DataFrame) -> None:
pd.options.mode.chained_assignment = None
df.loc[:, "message"] = df["message"].str.wrap(70)
print(
tabulate(
df,
headers=df.columns,
tablefmt="fancy_grid",
... | 256 | 0 | 23 |
89f0640de4fd375a5253a53749e440da70ac2ede | 55,096 | py | Python | legged_gym/envs/pat/pat.py | DARoSLab/legged_gym_pat | b258408e2b5ed243e9099dfd25be7a2733144527 | [
"BSD-3-Clause"
] | null | null | null | legged_gym/envs/pat/pat.py | DARoSLab/legged_gym_pat | b258408e2b5ed243e9099dfd25be7a2733144527 | [
"BSD-3-Clause"
] | null | null | null | legged_gym/envs/pat/pat.py | DARoSLab/legged_gym_pat | b258408e2b5ed243e9099dfd25be7a2733144527 | [
"BSD-3-Clause"
] | 1 | 2021-12-26T02:56:34.000Z | 2021-12-26T02:56:34.000Z | # SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source... | 52.472381 | 175 | 0.656 | # SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source... | 28,450 | 24,475 | 133 |
ce74d60f5f5a107f9ee5a1f4228678a7315f7264 | 855 | py | Python | contrib/logfaker/main.py | repejota/misto | 409486a35d05c0e5c63b081f17e40c145d5429df | [
"Apache-2.0"
] | 1 | 2018-02-03T13:10:36.000Z | 2018-02-03T13:10:36.000Z | contrib/logfaker/main.py | repejota/misto | 409486a35d05c0e5c63b081f17e40c145d5429df | [
"Apache-2.0"
] | null | null | null | contrib/logfaker/main.py | repejota/misto | 409486a35d05c0e5c63b081f17e40c145d5429df | [
"Apache-2.0"
] | null | null | null | import sys
import time
import random
from faker import Faker
if __name__ == "__main__":
main() | 22.5 | 72 | 0.623392 | import sys
import time
import random
from faker import Faker
def generate_fakelog():
fake = Faker()
# param nb_words - around how many words the sentence should contain
logstring = fake.sentence(nb_words=12)
return logstring
def log_stderr(logstring):
sys.stderr.write("{}{}".format(logstring, "\n... | 642 | 0 | 115 |
b800911eb46b47c4d99e9fdf9a6ac0b59ae659d7 | 1,913 | py | Python | 035_search_insert_position.py | Sanster/LeetCode | 5a0c448928b216b49c127c4542ae3cd74c797782 | [
"MIT"
] | 2 | 2018-10-13T15:12:55.000Z | 2020-06-07T09:35:40.000Z | 035_search_insert_position.py | Sanster/PyLeeCode | 5a0c448928b216b49c127c4542ae3cd74c797782 | [
"MIT"
] | null | null | null | 035_search_insert_position.py | Sanster/PyLeeCode | 5a0c448928b216b49c127c4542ae3cd74c797782 | [
"MIT"
] | null | null | null | from typing import List
if __name__ == "__main__":
s = Solution()
assert s.searchInsert([1, 3, 5, 6], 7) == 4
assert s.searchInsert([1, 3, 5, 6], 5) == 2
assert s.searchInsert([1, 3, 5, 6], 2) == 1
assert s.searchInsert([1, 3, 5, 6], 0) == 0
assert s.searchInsert([1, 2, 6, 8], 4) == 2
as... | 26.943662 | 65 | 0.472556 | from typing import List
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
"""
Time O(n)
"""
if target < nums[0]:
return 0
for i, num in enumerate(nums):
if num == target:
return i
if i < len(nu... | 0 | 1,046 | 23 |
132e190671940d4e2665081c441119af79b77322 | 42,905 | py | Python | Support/Python/unitybuild/main.py | panjea/open-brush | 8092ec49890b9090db9d92d7d1061279e621a28d | [
"Apache-2.0"
] | 321 | 2021-01-27T21:56:45.000Z | 2022-03-18T01:51:25.000Z | Support/Python/unitybuild/main.py | panjea/open-brush | 8092ec49890b9090db9d92d7d1061279e621a28d | [
"Apache-2.0"
] | 154 | 2021-01-28T11:21:59.000Z | 2022-03-29T17:20:40.000Z | Support/Python/unitybuild/main.py | panjea/open-brush | 8092ec49890b9090db9d92d7d1061279e621a28d | [
"Apache-2.0"
] | 76 | 2021-01-27T22:43:33.000Z | 2022-03-08T06:21:18.000Z | # Copyright 2020 The Tilt Brush Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 38.137778 | 219 | 0.586202 | # Copyright 2020 The Tilt Brush Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 17,930 | 0 | 507 |
f945e3e666096b8e477c7c8c157203755f0c6a75 | 8,487 | py | Python | build/lib/NMisS/spectral.py | JoshJson/nummethod | e9380f873a029205e2f843d4629e363a8f2f2f92 | [
"MIT"
] | null | null | null | build/lib/NMisS/spectral.py | JoshJson/nummethod | e9380f873a029205e2f843d4629e363a8f2f2f92 | [
"MIT"
] | null | null | null | build/lib/NMisS/spectral.py | JoshJson/nummethod | e9380f873a029205e2f843d4629e363a8f2f2f92 | [
"MIT"
] | null | null | null | # Импорты
import pip
try:
__import__('matplotlib')
except ImportError:
pip.main([ 'install', 'matplotlib' ])
try:
__import__('pandas')
except ImportError:
pip.main([ 'install', 'pandas' ])
try:
__import__('numpy')
except ImportError:
pip.main([ 'install', 'numpy' ])
try:
__import__('sci... | 33.023346 | 136 | 0.635207 | # Импорты
import pip
try:
__import__('matplotlib')
except ImportError:
pip.main([ 'install', 'matplotlib' ])
try:
__import__('pandas')
except ImportError:
pip.main([ 'install', 'pandas' ])
try:
__import__('numpy')
except ImportError:
pip.main([ 'install', 'numpy' ])
try:
__import__('sci... | 441 | 0 | 90 |
50a6002ad0d1602336d28f0eed8dd9eef7e1a3e4 | 4,417 | py | Python | app/auth/views.py | aacsspkt/autodealerappliation | c7ab3ae8e57e91c797129e87a13bd00d41bc4753 | [
"MIT"
] | null | null | null | app/auth/views.py | aacsspkt/autodealerappliation | c7ab3ae8e57e91c797129e87a13bd00d41bc4753 | [
"MIT"
] | null | null | null | app/auth/views.py | aacsspkt/autodealerappliation | c7ab3ae8e57e91c797129e87a13bd00d41bc4753 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.contrib.auth import authenticate, login
from django.urls.base import reverse, reverse_lazy
from django.views.generic import FormView
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic impor... | 31.55 | 102 | 0.719266 | from django.conf import settings
from django.contrib.auth import authenticate, login
from django.urls.base import reverse, reverse_lazy
from django.views.generic import FormView
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic impor... | 1,607 | 1,344 | 182 |
7d9bf7c4cb9152253f2a24165829f6da996638ff | 5,993 | bzl | Python | rules/providers.bzl | tjarvstrand/rules_scala | ff423d8bdd0e5383f8f2c048ffd7704bb51a91bf | [
"Apache-2.0"
] | 53 | 2019-01-07T23:15:32.000Z | 2021-09-24T00:27:40.000Z | rules/providers.bzl | tjarvstrand/rules_scala | ff423d8bdd0e5383f8f2c048ffd7704bb51a91bf | [
"Apache-2.0"
] | 101 | 2019-01-05T04:52:40.000Z | 2021-01-29T16:48:58.000Z | rules/providers.bzl | tjarvstrand/rules_scala | ff423d8bdd0e5383f8f2c048ffd7704bb51a91bf | [
"Apache-2.0"
] | 24 | 2019-01-23T07:54:28.000Z | 2022-02-10T19:42:07.000Z | load(
"//rules/common:private/utils.bzl",
_collect = "collect",
_collect_optionally = "collect_optionally",
)
ScalaConfiguration = provider(
doc = "Scala compile-time and runtime configuration",
fields = {
"version": "The Scala full version.",
"compiler_classpath": "The compiler cla... | 29.668317 | 107 | 0.627399 | load(
"//rules/common:private/utils.bzl",
_collect = "collect",
_collect_optionally = "collect_optionally",
)
ScalaConfiguration = provider(
doc = "Scala compile-time and runtime configuration",
fields = {
"version": "The Scala full version.",
"compiler_classpath": "The compiler cla... | 1,572 | 0 | 92 |
45b3e03f2eb6b546822d27fe4f031e25397a4f4f | 818 | py | Python | Python Snippets with Documentation/05 Data Structures/08 Lambda Functions.py | AhmedRaja1/Python-Beginner-s-Starter-Kit | 285cfbeb7207e6531954f21cae3a062f977ee5a0 | [
"MIT"
] | 1 | 2021-09-27T16:47:25.000Z | 2021-09-27T16:47:25.000Z | Python Snippets with Documentation/05 Data Structures/08 Lambda Functions.py | AhmedRaja1/Python-Beginner-s-Starter-Kit | 285cfbeb7207e6531954f21cae3a062f977ee5a0 | [
"MIT"
] | null | null | null | Python Snippets with Documentation/05 Data Structures/08 Lambda Functions.py | AhmedRaja1/Python-Beginner-s-Starter-Kit | 285cfbeb7207e6531954f21cae3a062f977ee5a0 | [
"MIT"
] | 1 | 2021-09-27T16:47:33.000Z | 2021-09-27T16:47:33.000Z | # 08 Lambda Functions
# List of complex objects, like a list of tuples, example a list of orders with product name and price
# in situations like this we need to define a function to sort the list, the above methos don't work
items = [
("Product1", 15),
("Product2", 50),
("Product3", 5)
]
print(items)
# ... | 34.083333 | 157 | 0.733496 | # 08 Lambda Functions
# List of complex objects, like a list of tuples, example a list of orders with product name and price
# in situations like this we need to define a function to sort the list, the above methos don't work
items = [
("Product1", 15),
("Product2", 50),
("Product3", 5)
]
print(items)
# ... | 0 | 0 | 0 |
ed7eea7563229f7e7807cec0d731f50dcda1a54a | 2,109 | py | Python | examples/metapath2vec.py | beneisner/pytorch_geometric | 53d44a96bd2de2753b1ab1d7153c026c92606a81 | [
"MIT"
] | 1 | 2022-02-17T09:40:17.000Z | 2022-02-17T09:40:17.000Z | examples/metapath2vec.py | beneisner/pytorch_geometric | 53d44a96bd2de2753b1ab1d7153c026c92606a81 | [
"MIT"
] | null | null | null | examples/metapath2vec.py | beneisner/pytorch_geometric | 53d44a96bd2de2753b1ab1d7153c026c92606a81 | [
"MIT"
] | 1 | 2021-08-25T08:06:57.000Z | 2021-08-25T08:06:57.000Z | # Reaches around 91.8% Micro-F1 after 5 epochs.
import os.path as osp
import torch
from torch_geometric.datasets import AMiner
from torch_geometric.nn import MetaPath2Vec
path = osp.join(osp.dirname(osp.realpath(__file__)), '..', 'data', 'AMiner')
dataset = AMiner(path)
data = dataset[0]
metapath = [
('author',... | 29.704225 | 79 | 0.598388 | # Reaches around 91.8% Micro-F1 after 5 epochs.
import os.path as osp
import torch
from torch_geometric.datasets import AMiner
from torch_geometric.nn import MetaPath2Vec
path = osp.join(osp.dirname(osp.realpath(__file__)), '..', 'data', 'AMiner')
dataset = AMiner(path)
data = dataset[0]
metapath = [
('author',... | 1,036 | 0 | 45 |
8a435781b636c786a2bdfa4300b811f927fd7383 | 298 | py | Python | top/api/rest/TbkContentEffectGetRequest.py | fengjinqi/python-taobao-sdk | abe829af75e69bd0f76003737fcf140595c86ac2 | [
"MIT"
] | 12 | 2019-10-24T01:36:03.000Z | 2021-08-10T10:52:03.000Z | top/api/rest/TbkContentEffectGetRequest.py | fengjinqi/python-taobao-sdk | abe829af75e69bd0f76003737fcf140595c86ac2 | [
"MIT"
] | 2 | 2020-10-12T07:12:48.000Z | 2021-06-02T03:15:47.000Z | top/api/rest/TbkContentEffectGetRequest.py | fengjinqi/python-taobao-sdk | abe829af75e69bd0f76003737fcf140595c86ac2 | [
"MIT"
] | 6 | 2019-10-24T01:36:37.000Z | 2021-04-06T17:21:59.000Z | '''
Created by auto_sdk on 2019.07.04
'''
from top.api.base import RestApi
| 24.833333 | 55 | 0.751678 | '''
Created by auto_sdk on 2019.07.04
'''
from top.api.base import RestApi
class TbkContentEffectGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.option = None
def getapiname(self):
return 'taobao.tbk.content.effect.get'
| 133 | 21 | 69 |
7583fbce2a0ad16c92032106b7f236dbf57ab848 | 11,536 | py | Python | fpga/myhdl/sampler.py | wingel/sds7102 | 77d85533d2ddfd26a0fb45f3ceff4cf8e6ff447a | [
"MIT"
] | 47 | 2016-07-16T20:03:19.000Z | 2021-12-21T03:35:41.000Z | fpga/myhdl/sampler.py | wingel/sds7102 | 77d85533d2ddfd26a0fb45f3ceff4cf8e6ff447a | [
"MIT"
] | null | null | null | fpga/myhdl/sampler.py | wingel/sds7102 | 77d85533d2ddfd26a0fb45f3ceff4cf8e6ff447a | [
"MIT"
] | 15 | 2016-07-29T08:10:11.000Z | 2020-11-28T15:49:55.000Z | #! /usr/bin/python
from myhdl import Signal, ConcatSignal, intbv, always, always_seq, always_comb, instances
from fifo.async import AsyncFifo
from fifo.dummy import DummyFifo, DummyReadFifo
from fifo.interleaver import FifoInterleaver
from wb import WbSlave
# This one could actually be split into two parts, one part... | 32.96 | 89 | 0.499133 | #! /usr/bin/python
from myhdl import Signal, ConcatSignal, intbv, always, always_seq, always_comb, instances
from fifo.async import AsyncFifo
from fifo.dummy import DummyFifo, DummyReadFifo
from fifo.interleaver import FifoInterleaver
from wb import WbSlave
class Sampler(WbSlave):
def __init__(self, addr_depth, ... | 10,569 | 23 | 401 |
573aa957045deedd4ff6531f2567358a98d435f1 | 2,557 | py | Python | algorithms/sorting/time_complexities.py | greglan/python_scripts | f2e98ed3fd975d79b0a6b569b65c850a7f4f3ab3 | [
"MIT"
] | null | null | null | algorithms/sorting/time_complexities.py | greglan/python_scripts | f2e98ed3fd975d79b0a6b569b65c850a7f4f3ab3 | [
"MIT"
] | null | null | null | algorithms/sorting/time_complexities.py | greglan/python_scripts | f2e98ed3fd975d79b0a6b569b65c850a7f4f3ab3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# !/usr/bin/env python
import matplotlib.pyplot as plt
from algorithms.sorting.merge_sort import merge_sort
from algorithms.sorting.utils import randomize
from algorithms.sorting.bubble_sort import bubble_sort
from algorithms.sorting.selection_sort import selection_sort
from algorithms.sorting... | 27.202128 | 60 | 0.684787 | # -*- coding: utf-8 -*-
# !/usr/bin/env python
import matplotlib.pyplot as plt
from algorithms.sorting.merge_sort import merge_sort
from algorithms.sorting.utils import randomize
from algorithms.sorting.bubble_sort import bubble_sort
from algorithms.sorting.selection_sort import selection_sort
from algorithms.sorting... | 873 | 0 | 69 |
84aa384ee2e57b4d6147f8b0b3b5f1c9ad8ba761 | 36,595 | py | Python | tests/unit/state_machines/bulkop/resource_system.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | 5 | 2020-06-04T10:20:33.000Z | 2020-10-26T15:09:19.000Z | tests/unit/state_machines/bulkop/resource_system.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | null | null | null | tests/unit/state_machines/bulkop/resource_system.py | tessia-project/tessia | b9ded8dc7f0b9a7a0ea00d95b5ccc4af4d2e7540 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 IBM Corp.
#
# 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, sof... | 37.687951 | 79 | 0.54614 | # Copyright 2019 IBM Corp.
#
# 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, sof... | 201 | 0 | 26 |
264159dcd39a2f2756c2edb6be616e6122c2b9c5 | 2,907 | py | Python | core/imperator.py | MyerFire/Myaer | 9de3838573bdd6718ec27660ea4cc2c958b79423 | [
"MIT"
] | 3 | 2020-05-13T15:51:39.000Z | 2020-07-13T06:37:36.000Z | core/imperator.py | myerfire/Myaer | dc96302a398e08409e2ad1176109f8e502949b5e | [
"MIT"
] | 2 | 2021-03-04T14:25:03.000Z | 2021-03-04T19:19:58.000Z | core/imperator.py | myerfire/Myaer | dc96302a398e08409e2ad1176109f8e502949b5e | [
"MIT"
] | 4 | 2020-05-22T22:49:05.000Z | 2021-03-11T15:33:19.000Z | """
MIT License
Copyright (c) 2020 Myer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 40.943662 | 116 | 0.662883 | """
MIT License
Copyright (c) 2020 Myer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 1,395 | -7 | 187 |
59318e0ffe655eba5798399e05174dad6f234294 | 9,623 | py | Python | util/mean_ap.py | Treiblesschorle/Mask_RCNN | 63e1a112d3f60d8c7cebc6151e5c50bab497198e | [
"MIT"
] | null | null | null | util/mean_ap.py | Treiblesschorle/Mask_RCNN | 63e1a112d3f60d8c7cebc6151e5c50bab497198e | [
"MIT"
] | null | null | null | util/mean_ap.py | Treiblesschorle/Mask_RCNN | 63e1a112d3f60d8c7cebc6151e5c50bab497198e | [
"MIT"
] | null | null | null | """Utilities for computing the Average Precision (AP) and mean Average Precision (mAP).
TODO improve naming of functions
TODO finish implementation
TODO document every function
TODO publish in own package
"""
from operator import itemgetter
import numpy as np
from scipy.ndimage import find_objects
# ===============... | 36.041199 | 99 | 0.60584 | """Utilities for computing the Average Precision (AP) and mean Average Precision (mAP).
TODO improve naming of functions
TODO finish implementation
TODO document every function
TODO publish in own package
"""
from operator import itemgetter
import numpy as np
from scipy.ndimage import find_objects
# ===============... | 330 | 0 | 50 |
38c2767363248bcdfdf69159abadfe1a28c23fa0 | 325 | py | Python | polyaxon/polyaxon/config_settings/integrations/hipchat_webhooks.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/polyaxon/config_settings/integrations/hipchat_webhooks.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/polyaxon/config_settings/integrations/hipchat_webhooks.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | from polyaxon.config_manager import config
INTEGRATIONS_HIPCHAT_WEBHOOKS = config.get_dict('POLYAXON_INTEGRATIONS_HIPCHAT_WEBHOOKS',
is_list=True,
is_optional=True,
is_local=T... | 46.428571 | 89 | 0.483077 | from polyaxon.config_manager import config
INTEGRATIONS_HIPCHAT_WEBHOOKS = config.get_dict('POLYAXON_INTEGRATIONS_HIPCHAT_WEBHOOKS',
is_list=True,
is_optional=True,
is_local=T... | 0 | 0 | 0 |
beb3423d90b0d8689cb7cdc3066f9e07f2435834 | 1,020 | py | Python | plugins/zen.py | llimllib/pyphage | 6c546955d6dc8a0fa2bf480b2a1dfab975155509 | [
"WTFPL"
] | 4 | 2015-11-05T08:56:39.000Z | 2017-06-19T15:12:04.000Z | plugins/zen.py | llimllib/pyphage | 6c546955d6dc8a0fa2bf480b2a1dfab975155509 | [
"WTFPL"
] | null | null | null | plugins/zen.py | llimllib/pyphage | 6c546955d6dc8a0fa2bf480b2a1dfab975155509 | [
"WTFPL"
] | null | null | null | """/zen:"""
from chatbot import send
| 145.714286 | 917 | 0.765686 | """/zen:"""
from chatbot import send
def on_message(message):
if message[u"message"] == u"/zen":
send(message['topic']['id'], u"The Zen of Python, by Tim Peters\n\nBeautiful is better than ugly.\nExplicit is better than implicit.\nSimple is better than complex.\nComplex is better than complicated.\nFlat is... | 960 | 0 | 23 |
d11aba81d332f7fa297dcc0d01c6832dcc202308 | 2,044 | py | Python | videoclub/migrations/0001_initial.py | lhbelfanti/django-crud | 68d29c388b9697787894270168c8e126bf5c2eca | [
"MIT"
] | null | null | null | videoclub/migrations/0001_initial.py | lhbelfanti/django-crud | 68d29c388b9697787894270168c8e126bf5c2eca | [
"MIT"
] | null | null | null | videoclub/migrations/0001_initial.py | lhbelfanti/django-crud | 68d29c388b9697787894270168c8e126bf5c2eca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-10 02:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| 37.851852 | 128 | 0.569472 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-10 02:36
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Cre... | 0 | 1,831 | 23 |
2a68ed5870648ffb60de10d6e2449ce58303384b | 3,788 | py | Python | final_project_group3/src/spawn_marker_on_robot.py | njnovak/RoboticsFinalProject | 25cec640e1ee0e0803be6fd054e9758bd4f45c2f | [
"MIT"
] | null | null | null | final_project_group3/src/spawn_marker_on_robot.py | njnovak/RoboticsFinalProject | 25cec640e1ee0e0803be6fd054e9758bd4f45c2f | [
"MIT"
] | null | null | null | final_project_group3/src/spawn_marker_on_robot.py | njnovak/RoboticsFinalProject | 25cec640e1ee0e0803be6fd054e9758bd4f45c2f | [
"MIT"
] | null | null | null | #! /usr/bin/env python2.7
import time
import rospy
from math import pi
from std_srvs.srv import Empty
from gazebo_ros_link_attacher.srv import Attach
from gazebo_msgs.srv import SpawnModel, SpawnModelRequest
from gazebo_msgs.msg import ModelStates
from geometry_msgs.msg import Quaternion
from tf.transformations impor... | 35.074074 | 96 | 0.713569 | #! /usr/bin/env python2.7
import time
import rospy
from math import pi
from std_srvs.srv import Empty
from gazebo_ros_link_attacher.srv import Attach
from gazebo_msgs.srv import SpawnModel, SpawnModelRequest
from gazebo_msgs.msg import ModelStates
from geometry_msgs.msg import Quaternion
from tf.transformations impor... | 0 | 0 | 0 |
965824a252f4ed6af6e0f089b33832fe9f856105 | 5,392 | py | Python | tensorflow_gnn/runner/tasks/classification_test.py | tensorflow/gnn | c529f2a83230c028186f6c6754e17587e4ec90d1 | [
"Apache-2.0"
] | 611 | 2021-11-18T06:04:10.000Z | 2022-03-29T11:46:42.000Z | tensorflow_gnn/runner/tasks/classification_test.py | tensorflow/gnn | c529f2a83230c028186f6c6754e17587e4ec90d1 | [
"Apache-2.0"
] | 25 | 2021-11-18T17:21:12.000Z | 2022-03-31T06:36:55.000Z | tensorflow_gnn/runner/tasks/classification_test.py | tensorflow/gnn | c529f2a83230c028186f6c6754e17587e4ec90d1 | [
"Apache-2.0"
] | 52 | 2021-11-18T23:12:30.000Z | 2022-03-27T06:31:08.000Z | """Tests for classification."""
from typing import Sequence
from absl.testing import parameterized
import tensorflow as tf
import tensorflow_gnn as tfgnn
from tensorflow_gnn.runner import orchestration
from tensorflow_gnn.runner.tasks import classification
as_tensor = tf.convert_to_tensor
as_ragged = tf.ragged.const... | 32.287425 | 80 | 0.648739 | """Tests for classification."""
from typing import Sequence
from absl.testing import parameterized
import tensorflow as tf
import tensorflow_gnn as tfgnn
from tensorflow_gnn.runner import orchestration
from tensorflow_gnn.runner.tasks import classification
as_tensor = tf.convert_to_tensor
as_ragged = tf.ragged.const... | 1,864 | 2,852 | 23 |
0ae89423c5b2fb528e3c0b81cb36311cdc56be5e | 472 | py | Python | eelbrain/_io/tests/test_pickle.py | jpkulasingham/Eelbrain | 1061ce0b781a8e55ec187723b58491a5cde32e08 | [
"BSD-3-Clause"
] | null | null | null | eelbrain/_io/tests/test_pickle.py | jpkulasingham/Eelbrain | 1061ce0b781a8e55ec187723b58491a5cde32e08 | [
"BSD-3-Clause"
] | null | null | null | eelbrain/_io/tests/test_pickle.py | jpkulasingham/Eelbrain | 1061ce0b781a8e55ec187723b58491a5cde32e08 | [
"BSD-3-Clause"
] | null | null | null | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from eelbrain import datasets, load
from eelbrain._utils import IS_OSX
from eelbrain.testing import assert_dataobj_equal, file_path
| 31.466667 | 60 | 0.754237 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
from eelbrain import datasets, load
from eelbrain._utils import IS_OSX
from eelbrain.testing import assert_dataobj_equal, file_path
def test_pickle():
ds = datasets.get_uts()
decimal = None if IS_OSX else 15
ds_2 = load.unpickle(file_path('uts-py2.... | 259 | 0 | 23 |
506aa46f2760accb6c7d0ce527f1ea6690b3c489 | 542 | py | Python | jrecomments/migrations/0008_auto_20211105_0129.py | ChristianJStarr/jrecomments | 2c4d72e8848d639e3b1004e58b2cc8e0889ad23d | [
"MIT"
] | null | null | null | jrecomments/migrations/0008_auto_20211105_0129.py | ChristianJStarr/jrecomments | 2c4d72e8848d639e3b1004e58b2cc8e0889ad23d | [
"MIT"
] | null | null | null | jrecomments/migrations/0008_auto_20211105_0129.py | ChristianJStarr/jrecomments | 2c4d72e8848d639e3b1004e58b2cc8e0889ad23d | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-11-05 05:29
from django.db import migrations, models
| 22.583333 | 51 | 0.575646 | # Generated by Django 3.1.6 on 2021-11-05 05:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jrecomments', '0007_auto_20211028_0505'),
]
operations = [
migrations.AddField(
model_name='podcast',
name='populari... | 0 | 428 | 23 |
d3ba0857157cc7eea703c74a87631d271d65d963 | 2,721 | py | Python | memo/_base.py | bradday4/memo | 2ab048999ae88b2b99c862ffcc726f76a7d9bc80 | [
"MIT"
] | 82 | 2020-11-29T02:24:55.000Z | 2022-02-21T04:56:38.000Z | memo/_base.py | bradday4/memo | 2ab048999ae88b2b99c862ffcc726f76a7d9bc80 | [
"MIT"
] | 16 | 2020-12-04T16:43:13.000Z | 2022-02-22T09:51:23.000Z | memo/_base.py | bradday4/memo | 2ab048999ae88b2b99c862ffcc726f76a7d9bc80 | [
"MIT"
] | 9 | 2020-11-29T16:06:52.000Z | 2021-11-11T14:52:49.000Z | import orjson
from typing import Callable, List
from functools import wraps
def memlist(data: List):
"""
Remembers input/output of a function in python list.
Arguments:
data: a list to push received data into
Example
```python
from memo import memlist
data = []
@memlist(da... | 21.595238 | 79 | 0.54943 | import orjson
from typing import Callable, List
from functools import wraps
def memlist(data: List):
"""
Remembers input/output of a function in python list.
Arguments:
data: a list to push received data into
Example
```python
from memo import memlist
data = []
@memlist(da... | 811 | 0 | 81 |
6f8be6f2fe0b3cb3451b64b271ff92eda49b402d | 2,041 | py | Python | baxter_end_effector_control/scripts/end_effector_trajectory_client.py | birlrobotics/birlBaxter_demos | a4871cbf2587a759c958c8451746554e1663e829 | [
"MIT"
] | 24 | 2016-12-29T11:17:41.000Z | 2021-12-06T00:49:10.000Z | baxter_end_effector_control/scripts/end_effector_trajectory_client.py | birlrobotics/birlBaxter_demos | a4871cbf2587a759c958c8451746554e1663e829 | [
"MIT"
] | 2 | 2019-11-20T05:52:02.000Z | 2019-12-30T09:07:56.000Z | baxter_end_effector_control/scripts/end_effector_trajectory_client.py | birlrobotics/birlBaxter_demos | a4871cbf2587a759c958c8451746554e1663e829 | [
"MIT"
] | 9 | 2018-02-10T06:12:12.000Z | 2021-10-11T11:56:07.000Z | #!/usr/bin/env python
import rospy
import struct
import sys
#import pdb
from copy import copy
from geometry_msgs.msg import (
PoseStamped,
Pose,
Point,
Quaternion,
)
from std_msgs.msg import Header
from baxter_core_msgs.msg import (
JointCommand
)
import actionlib
from control_msgs.msg import (
... | 26.506494 | 77 | 0.651151 | #!/usr/bin/env python
import rospy
import struct
import sys
#import pdb
from copy import copy
from geometry_msgs.msg import (
PoseStamped,
Pose,
Point,
Quaternion,
)
from std_msgs.msg import Header
from baxter_core_msgs.msg import (
JointCommand
)
import actionlib
from control_msgs.msg import (
... | 1,432 | 0 | 50 |
05ec669d2272999589562125fd1618b674dfc761 | 10,739 | py | Python | cyphort_connector.py | splunk-soar-connectors/cyphort | f95c5d01181bcf3a4a2bcfdca94548efd19714a1 | [
"Apache-2.0"
] | null | null | null | cyphort_connector.py | splunk-soar-connectors/cyphort | f95c5d01181bcf3a4a2bcfdca94548efd19714a1 | [
"Apache-2.0"
] | 2 | 2021-11-29T12:11:26.000Z | 2021-12-06T06:00:43.000Z | cyphort_connector.py | splunk-soar-connectors/cyphort | f95c5d01181bcf3a4a2bcfdca94548efd19714a1 | [
"Apache-2.0"
] | null | null | null | # --
# File: cyphort_connector.py
# Copyright (c) 2014-2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 35.796667 | 130 | 0.655648 | # --
# File: cyphort_connector.py
# Copyright (c) 2014-2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 8,397 | 1,012 | 23 |
3f8f06f600bfef37e6fa4cad5791e6549d0223a6 | 420 | py | Python | QuantFin_Python/Lecture00_Plot_heart.py | jamesfang8499/QuantFin | b4abe18d1baa8c52e9c890268b958f85576fd9fa | [
"Apache-2.0"
] | 24 | 2017-08-06T06:37:58.000Z | 2021-09-04T01:09:52.000Z | QuantFin_Python/Lecture00_Plot_heart.py | minying1999/QuantFin | b4abe18d1baa8c52e9c890268b958f85576fd9fa | [
"Apache-2.0"
] | null | null | null | QuantFin_Python/Lecture00_Plot_heart.py | minying1999/QuantFin | b4abe18d1baa8c52e9c890268b958f85576fd9fa | [
"Apache-2.0"
] | 22 | 2016-08-24T20:50:41.000Z | 2022-01-03T05:54:59.000Z | import matplotlib.pylab as plt
import numpy as np
import math as mm
llen=1000;
x=np.zeros(llen);
y=np.zeros(llen);
for i in range(0,llen):
t=2*i*(mm.pi)/llen;
x[i]=16*mm.pow(mm.sin(t),3);
y[i]=13*mm.cos(t)-5*(mm.cos(t*2))-2*mm.cos(3*t)-mm.cos(4*t);
plt.figu... | 22.105263 | 63 | 0.564286 | import matplotlib.pylab as plt
import numpy as np
import math as mm
llen=1000;
x=np.zeros(llen);
y=np.zeros(llen);
for i in range(0,llen):
t=2*i*(mm.pi)/llen;
x[i]=16*mm.pow(mm.sin(t),3);
y[i]=13*mm.cos(t)-5*(mm.cos(t*2))-2*mm.cos(3*t)-mm.cos(4*t);
plt.figu... | 0 | 0 | 0 |
65c48cad486d6b88b95c4740ed0cb3745cb8ba08 | 5,763 | py | Python | steelpy/codes/api/main.py | svortega/steelpy | bef35eb8ab8728fc29f57b7070b5f3bac0b0e840 | [
"MIT"
] | 4 | 2021-09-28T12:52:01.000Z | 2022-02-24T22:30:22.000Z | steelpy/codes/api/main.py | svortega/steelpy | bef35eb8ab8728fc29f57b7070b5f3bac0b0e840 | [
"MIT"
] | null | null | null | steelpy/codes/api/main.py | svortega/steelpy | bef35eb8ab8728fc29f57b7070b5f3bac0b0e840 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2019-2021 steelpy
#
# Python stdlib imports
#import math
#import datetime
from typing import Union, ClassVar
# package imports
from steelpy.codes.api.wsd_22ed import APIwsd22ed
from steelpy.design.beam.process import BeamDesignParameters, CodeResults
#from steelpy.f2uModel.load.operations.actions im... | 31.491803 | 87 | 0.521083 | #
# Copyright (c) 2019-2021 steelpy
#
# Python stdlib imports
#import math
#import datetime
from typing import Union, ClassVar
# package imports
from steelpy.codes.api.wsd_22ed import APIwsd22ed
from steelpy.design.beam.process import BeamDesignParameters, CodeResults
#from steelpy.f2uModel.load.operations.actions im... | 0 | 0 | 0 |
c44c60d0144954e47067015221863bd1091c350d | 210 | py | Python | tests/context.py | stpotter16/splineDIC | d61f9615699aade74e14f56f3c9ede505d86e39f | [
"MIT"
] | null | null | null | tests/context.py | stpotter16/splineDIC | d61f9615699aade74e14f56f3c9ede505d86e39f | [
"MIT"
] | null | null | null | tests/context.py | stpotter16/splineDIC | d61f9615699aade74e14f56f3c9ede505d86e39f | [
"MIT"
] | 1 | 2020-08-29T22:17:26.000Z | 2020-08-29T22:17:26.000Z | import os
import sys
# Add the library top directory to first position in $PATH variable
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import splineDIC
import numpy as np
| 23.333333 | 82 | 0.757143 | import os
import sys
# Add the library top directory to first position in $PATH variable
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import splineDIC
import numpy as np
| 0 | 0 | 0 |
5e9c51abce2c25e47d6aac1b48488e477a66919a | 19,058 | py | Python | _tools/testservice.py | sailfish009/bsdf | e69feaf43d4d553d2bfaeedd87396c4bf7054936 | [
"BSD-2-Clause"
] | null | null | null | _tools/testservice.py | sailfish009/bsdf | e69feaf43d4d553d2bfaeedd87396c4bf7054936 | [
"BSD-2-Clause"
] | null | null | null | _tools/testservice.py | sailfish009/bsdf | e69feaf43d4d553d2bfaeedd87396c4bf7054936 | [
"BSD-2-Clause"
] | null | null | null | """
This script provides a service to test BSDF implementations of different
languages. It is written in Python, since BSDF's reference implementation is.
To use, import this module and use ``main(test_dir, *exe)``. The test_dir
will be the current directory when the command is executed. The exe is the
command to run,... | 33.202091 | 118 | 0.570836 | """
This script provides a service to test BSDF implementations of different
languages. It is written in Python, since BSDF's reference implementation is.
To use, import this module and use ``main(test_dir, *exe)``. The test_dir
will be the current directory when the command is executed. The exe is the
command to run,... | 8,354 | 0 | 138 |
5c16bff65521051df276d54af0e3b14ca016ad2a | 10,971 | py | Python | infra/deploy_pipeline_construct.py | acere/amazon-sagemaker-drift-detection | 6a4950bde73b9c17c34ab771300f9ca1e279d5f6 | [
"MIT-0"
] | 27 | 2021-07-28T14:34:19.000Z | 2022-03-17T03:40:38.000Z | infra/deploy_pipeline_construct.py | acere/amazon-sagemaker-drift-detection | 6a4950bde73b9c17c34ab771300f9ca1e279d5f6 | [
"MIT-0"
] | 10 | 2021-07-30T01:11:55.000Z | 2021-10-25T00:20:36.000Z | infra/deploy_pipeline_construct.py | acere/amazon-sagemaker-drift-detection | 6a4950bde73b9c17c34ab771300f9ca1e279d5f6 | [
"MIT-0"
] | 9 | 2021-07-28T03:47:47.000Z | 2022-03-22T02:29:40.000Z | from aws_cdk import (
core,
aws_codebuild as codebuild,
aws_codecommit as codecommit,
aws_codepipeline as codepipeline,
aws_codepipeline_actions as codepipeline_actions,
aws_events as events,
aws_events_targets as targets,
aws_iam as iam,
aws_s3 as s3,
)
class DeployPipelineConstru... | 40.040146 | 122 | 0.47106 | from aws_cdk import (
core,
aws_codebuild as codebuild,
aws_codecommit as codecommit,
aws_codepipeline as codepipeline,
aws_codepipeline_actions as codepipeline_actions,
aws_events as events,
aws_events_targets as targets,
aws_iam as iam,
aws_s3 as s3,
)
class DeployPipelineConstru... | 10,558 | 0 | 27 |
9b38972815095daa65f912f91a4dea5aa0b41894 | 6,071 | py | Python | krypton/hkpserver/controllers/lookupcontroller.py | zerodine/krypton | 3876b37739f0b9110f460bf1d0aec668d216a7b7 | [
"Apache-2.0"
] | 1 | 2020-11-17T16:29:52.000Z | 2020-11-17T16:29:52.000Z | krypton/hkpserver/controllers/lookupcontroller.py | zerodine/krypton | 3876b37739f0b9110f460bf1d0aec668d216a7b7 | [
"Apache-2.0"
] | null | null | null | krypton/hkpserver/controllers/lookupcontroller.py | zerodine/krypton | 3876b37739f0b9110f460bf1d0aec668d216a7b7 | [
"Apache-2.0"
] | null | null | null | __author__ = "Thomas Spycher, Philipp Spinnler"
__copyright__ = "Copyright 2013, Zerodine GmbH (zerodine.com) "
__credits__ = ["Thomas Spycher", "Philipp Spinnler"]
__license__ = "Apache-2.0"
__maintainer__ = "Thomas Spycher"
__email__ = "me@tspycher.com"
__status__ = "Development"
import tornado.template
from baseco... | 29.470874 | 103 | 0.590348 | __author__ = "Thomas Spycher, Philipp Spinnler"
__copyright__ = "Copyright 2013, Zerodine GmbH (zerodine.com) "
__credits__ = ["Thomas Spycher", "Philipp Spinnler"]
__license__ = "Apache-2.0"
__maintainer__ = "Thomas Spycher"
__email__ = "me@tspycher.com"
__status__ = "Development"
import tornado.template
from baseco... | 577 | 0 | 27 |
53111fd36d05457f116c77c9570c539dce3e12df | 1,481 | py | Python | translators/FLIR-IdentiFinder-ResultsTranslator.py | LLNL/RASE | 6e3452c35297709de3de8d9318c25e6346214c79 | [
"MIT"
] | 5 | 2020-01-30T14:13:30.000Z | 2021-06-25T16:37:50.000Z | translators/FLIR-IdentiFinder-ResultsTranslator.py | LLNL/RASE | 6e3452c35297709de3de8d9318c25e6346214c79 | [
"MIT"
] | null | null | null | translators/FLIR-IdentiFinder-ResultsTranslator.py | LLNL/RASE | 6e3452c35297709de3de8d9318c25e6346214c79 | [
"MIT"
] | 1 | 2019-09-10T20:38:19.000Z | 2019-09-10T20:38:19.000Z | ### Static Parameters ###
# TemplateSpectrum = 'FLIR-ID-2_TemplateSpectrum_CmdLine.n42'
### End of the Static Parameters ###
import os
import xml.etree.ElementTree as ET
from src.rase_functions import write_results
def retrieve_FLIR_Results(filepath):
"""
:param filepath:
:return:
"""
it = ET.p... | 26.927273 | 108 | 0.673869 | ### Static Parameters ###
# TemplateSpectrum = 'FLIR-ID-2_TemplateSpectrum_CmdLine.n42'
### End of the Static Parameters ###
import os
import xml.etree.ElementTree as ET
from src.rase_functions import write_results
def retrieve_FLIR_Results(filepath):
"""
:param filepath:
:return:
"""
it = ET.p... | 348 | 0 | 23 |
3ff276c92cd28068459bcf07831c3fcacaf3ddfd | 2,020 | py | Python | product.py | ev-agelos/lebara-topup | 24fb8aedd1665ef2441e06d5dcc48c9c34d4f42f | [
"MIT"
] | null | null | null | product.py | ev-agelos/lebara-topup | 24fb8aedd1665ef2441e06d5dcc48c9c34d4f42f | [
"MIT"
] | null | null | null | product.py | ev-agelos/lebara-topup | 24fb8aedd1665ef2441e06d5dcc48c9c34d4f42f | [
"MIT"
] | null | null | null | import re
from bs4 import BeautifulSoup
| 28.857143 | 78 | 0.558416 | import re
from bs4 import BeautifulSoup
class Form:
def __init__(self, html):
if html.name == 'form':
self._form = html
else:
self._form = html.find('form')
self.action = self._form.attrs['action']
self.fields = self._form.find_all(re.compile('(input|sele... | 1,703 | 204 | 69 |
cf26e52a1dab727db1e93ba2ea1004133b406c20 | 4,366 | py | Python | tello_formation/src/controller.py | PedroS235/TelloSwarm | 193abba280efd467318f9d19e2fc91433ea75525 | [
"MIT"
] | null | null | null | tello_formation/src/controller.py | PedroS235/TelloSwarm | 193abba280efd467318f9d19e2fc91433ea75525 | [
"MIT"
] | null | null | null | tello_formation/src/controller.py | PedroS235/TelloSwarm | 193abba280efd467318f9d19e2fc91433ea75525 | [
"MIT"
] | 2 | 2021-11-24T01:54:22.000Z | 2022-02-16T21:00:26.000Z | #!/usr/bin/python3
import math
import threading
import numpy as np
import rospy
import tf2_ros
from geometry_msgs.msg import TransformStamped
from tello_formation.msg import GotoCommand
from tello_ros.srv import TelloCommand
class TelloController:
"""
This class is the one that controls the Tello. (It... | 38.982143 | 127 | 0.617957 | #!/usr/bin/python3
import math
import threading
import numpy as np
import rospy
import tf2_ros
from geometry_msgs.msg import TransformStamped
from tello_formation.msg import GotoCommand
from tello_ros.srv import TelloCommand
class TelloController:
"""
This class is the one that controls the Tello. (It... | 0 | 0 | 0 |
d516501d37d636374903bca64751792fad00cfc7 | 8,936 | py | Python | codenerix/templatetags/codenerix_lists.py | centrologic/django-codenerix | 136d3cab1a19d2dfac810f902e3fcb5ea94e13ba | [
"Apache-2.0"
] | 28 | 2017-02-25T01:39:34.000Z | 2018-01-22T21:48:10.000Z | codenerix/templatetags/codenerix_lists.py | centrologic/django-codenerix | 136d3cab1a19d2dfac810f902e3fcb5ea94e13ba | [
"Apache-2.0"
] | 2 | 2017-03-10T12:31:33.000Z | 2017-07-14T07:03:07.000Z | codenerix/templatetags/codenerix_lists.py | centrologic/django-codenerix | 136d3cab1a19d2dfac810f902e3fcb5ea94e13ba | [
"Apache-2.0"
] | 6 | 2017-03-10T12:00:02.000Z | 2017-11-22T20:15:42.000Z | # -*- coding: utf-8 -*-
#
# django-codenerix
#
# Codenerix GNU
#
# Project URL : http://www.codenerix.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | 26.595238 | 206 | 0.611907 | # -*- coding: utf-8 -*-
#
# django-codenerix
#
# Codenerix GNU
#
# Project URL : http://www.codenerix.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | 6,573 | -1 | 516 |
b226a2f9160586734bf30b5397128d8472b1c61f | 1,205 | py | Python | experiment/models.py | piotrb5e3/1023alternative-backend | 3a3882a906ae17d9d670d600d68063e4a9ea7102 | [
"MIT"
] | null | null | null | experiment/models.py | piotrb5e3/1023alternative-backend | 3a3882a906ae17d9d670d600d68063e4a9ea7102 | [
"MIT"
] | null | null | null | experiment/models.py | piotrb5e3/1023alternative-backend | 3a3882a906ae17d9d670d600d68063e4a9ea7102 | [
"MIT"
] | null | null | null | from django.db import models
from experiment_session.models import ExperimentSession
from django.core.validators import MinValueValidator
| 24.591837 | 77 | 0.672199 | from django.db import models
from experiment_session.models import ExperimentSession
from django.core.validators import MinValueValidator
class Experiment(models.Model):
LIGHTOFF_FIXED = 'fixed'
LIGHTOFF_WAITING = 'waiting'
_LIGHTOFF_CHOICES = (
(LIGHTOFF_FIXED, 'Fixed'),
(LIGHTOFF_WAITING... | 22 | 1,021 | 23 |
73e77b9cfa78dd7db668c8f5619e8d259dea0454 | 3,292 | py | Python | novaclient/tests/functional/v2/legacy/test_keypairs.py | dtroyer/python-novaclient | 4c483322fe5454c8ece66cc9c86cbc0702e14368 | [
"Apache-1.1"
] | null | null | null | novaclient/tests/functional/v2/legacy/test_keypairs.py | dtroyer/python-novaclient | 4c483322fe5454c8ece66cc9c86cbc0702e14368 | [
"Apache-1.1"
] | null | null | null | novaclient/tests/functional/v2/legacy/test_keypairs.py | dtroyer/python-novaclient | 4c483322fe5454c8ece66cc9c86cbc0702e14368 | [
"Apache-1.1"
] | 1 | 2019-01-11T16:15:52.000Z | 2019-01-11T16:15:52.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 35.021277 | 78 | 0.670109 | # 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
# d... | 2,086 | 0 | 324 |
123ab816b0bb039ae3617996dce9aaf4843f1459 | 5,377 | py | Python | rabbit_force/__main__.py | elaredo/rabbit-force-wefox | ec5108f9341ace8a6d44d424c8174bba41558ba3 | [
"MIT"
] | 19 | 2018-10-25T15:31:14.000Z | 2022-01-18T17:47:39.000Z | rabbit_force/__main__.py | elaredo/rabbit-force-wefox | ec5108f9341ace8a6d44d424c8174bba41558ba3 | [
"MIT"
] | 1 | 2021-01-13T13:28:35.000Z | 2021-01-13T13:28:35.000Z | rabbit_force/__main__.py | elaredo/rabbit-force-wefox | ec5108f9341ace8a6d44d424c8174bba41558ba3 | [
"MIT"
] | 1 | 2019-05-10T10:44:48.000Z | 2019-05-10T10:44:48.000Z | """rabbit_force application entrypoint"""
import logging
from enum import IntEnum
from collections import namedtuple
import click
from .config import load_config
from .app import Application
from ._metadata import TITLE, VERSION
class Verbosity(IntEnum):
"""Logging detail level"""
#: Application messages wi... | 36.828767 | 79 | 0.686628 | """rabbit_force application entrypoint"""
import logging
from enum import IntEnum
from collections import namedtuple
import click
from .config import load_config
from .app import Application
from ._metadata import TITLE, VERSION
class Verbosity(IntEnum):
"""Logging detail level"""
#: Application messages wi... | 0 | 0 | 0 |
b5190741e4210a2b522a3e9dbfce2443dd241b22 | 1,829 | py | Python | ttcal/calfns.py | datakortet/ttcal | 0df8000d1b4e6d64d25a0fe1dcdbd328dcc5a8af | [
"MIT"
] | null | null | null | ttcal/calfns.py | datakortet/ttcal | 0df8000d1b4e6d64d25a0fe1dcdbd328dcc5a8af | [
"MIT"
] | 3 | 2020-03-06T10:36:41.000Z | 2022-01-19T16:21:20.000Z | ttcal/calfns.py | datakortet/ttcal | 0df8000d1b4e6d64d25a0fe1dcdbd328dcc5a8af | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Misc. calendar functions.
"""
import datetime
from itertools import islice
def chop(it, n):
"""Chop iterator into `n` size chuchks.
"""
while 1:
s = list(islice(it, n))
if not s:
break
yield s
def isoweek(year, week):
"""Iterate over th... | 23.753247 | 66 | 0.553855 | # -*- coding: utf-8 -*-
"""
Misc. calendar functions.
"""
import datetime
from itertools import islice
def chop(it, n):
"""Chop iterator into `n` size chuchks.
"""
while 1:
s = list(islice(it, n))
if not s:
break
yield s
def isoweek(year, week):
"""Iterate over th... | 0 | 0 | 0 |
152efb7234d7b1e4ea2dc79795f1d7eb74d7f237 | 1,026 | py | Python | tests/admin/test_utils.py | kaoslabsinc/django-building-blocks | b5f74121b4002e2b96b5addd6f2593c1a2cead98 | [
"BSD-3-Clause"
] | 1 | 2021-08-03T12:42:37.000Z | 2021-08-03T12:42:37.000Z | tests/admin/test_utils.py | kaoslabsinc/django-building-blocks | b5f74121b4002e2b96b5addd6f2593c1a2cead98 | [
"BSD-3-Clause"
] | 4 | 2021-07-27T18:22:35.000Z | 2021-08-06T21:55:39.000Z | tests/admin/test_utils.py | kaoslabsinc/django-building-blocks | b5f74121b4002e2b96b5addd6f2593c1a2cead98 | [
"BSD-3-Clause"
] | null | null | null | from building_blocks.admin.utils import render_element, json_field_pp
| 38 | 113 | 0.633528 | from building_blocks.admin.utils import render_element, json_field_pp
def test_json_field_pp_unsafe():
d = {'field': "<script>malicious_code()</script>"}
html = json_field_pp(d)
assert '<script>' in html
def test_render_element():
assert render_element('br') == '''<br >'''
assert render_el... | 860 | 0 | 92 |
e888d01baaac42577ea470673b87bcd7cd8c4070 | 473 | py | Python | tests/types/test_choices.py | kikeh/django-graphql-extensions | 951b295235ca68270066cc70148e2ae937d4eb56 | [
"MIT"
] | 1 | 2019-06-19T12:05:24.000Z | 2019-06-19T12:05:24.000Z | tests/types/test_choices.py | kikeh/django-graphql-extensions | 951b295235ca68270066cc70148e2ae937d4eb56 | [
"MIT"
] | null | null | null | tests/types/test_choices.py | kikeh/django-graphql-extensions | 951b295235ca68270066cc70148e2ae937d4eb56 | [
"MIT"
] | null | null | null | from django.test import TestCase
from graphql.language import ast
from graphql_extensions import types
| 22.52381 | 65 | 0.691332 | from django.test import TestCase
from graphql.language import ast
from graphql_extensions import types
class ChoicesTypeTests(TestCase):
def test_choices(self):
value = 'test'
class TestChoices(types.Choices):
CHOICES = (value,)
choices_type = TestChoices()
node = ... | 305 | 12 | 50 |
67ef096528d1ee6b4e1b4055f2b7e562ad36570c | 1,583 | py | Python | formulae/terms/call_utils.py | davipatti/formulae | f5ea0ec8be5a422638db18f78296b3bc74d54c2f | [
"MIT"
] | 24 | 2021-02-23T15:56:20.000Z | 2022-03-22T18:14:07.000Z | formulae/terms/call_utils.py | davipatti/formulae | f5ea0ec8be5a422638db18f78296b3bc74d54c2f | [
"MIT"
] | 49 | 2021-03-09T10:24:25.000Z | 2022-03-11T14:20:35.000Z | formulae/terms/call_utils.py | davipatti/formulae | f5ea0ec8be5a422638db18f78296b3bc74d54c2f | [
"MIT"
] | 9 | 2021-01-25T20:23:25.000Z | 2022-03-10T07:21:16.000Z | from formulae.utils import flatten_list
class CallVarsExtractor:
"""Visitor that extracts variable names present in a model formula"""
| 29.314815 | 87 | 0.665193 | from formulae.utils import flatten_list
class CallVarsExtractor:
"""Visitor that extracts variable names present in a model formula"""
def __init__(self, expr):
self.expr = expr
def get(self):
return list(flatten_list(self.expr.accept(self)))
def visitCallTerm(self, term):
r... | 1,037 | 0 | 405 |
633e8550238563d51de704b19688e7f20990fce1 | 1,586 | py | Python | watcher/tests/cmd/test_status.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | 64 | 2015-10-18T02:57:24.000Z | 2022-01-13T11:27:51.000Z | watcher/tests/cmd/test_status.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | null | null | null | watcher/tests/cmd/test_status.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | 35 | 2015-12-25T13:53:21.000Z | 2021-07-19T15:50:16.000Z | # Copyright (c) 2018 NEC, Corp.
#
# 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 agr... | 36.883721 | 78 | 0.718789 | # Copyright (c) 2018 NEC, Corp.
#
# 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 agr... | 702 | 18 | 104 |
e6b048059a16b349f42fea0bcebaba02d0321e0a | 243 | py | Python | homeassistant/components/abode/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/abode/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/abode/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Constants for the Abode Security System component."""
import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "abode"
ATTRIBUTION = "Data provided by goabode.com"
DEFAULT_CACHEDB = "abodepy_cache.pickle"
CONF_POLLING = "polling"
| 22.090909 | 56 | 0.773663 | """Constants for the Abode Security System component."""
import logging
LOGGER = logging.getLogger(__package__)
DOMAIN = "abode"
ATTRIBUTION = "Data provided by goabode.com"
DEFAULT_CACHEDB = "abodepy_cache.pickle"
CONF_POLLING = "polling"
| 0 | 0 | 0 |
088813b6777ecdf690df1f3d7f0a8520b84c6023 | 170 | py | Python | jqtodobackend/settings.py | johannes-qvarford/jq-todo-backend-py | 8b54023f89174098991c0ee59d8798ace58a6649 | [
"MIT"
] | null | null | null | jqtodobackend/settings.py | johannes-qvarford/jq-todo-backend-py | 8b54023f89174098991c0ee59d8798ace58a6649 | [
"MIT"
] | null | null | null | jqtodobackend/settings.py | johannes-qvarford/jq-todo-backend-py | 8b54023f89174098991c0ee59d8798ace58a6649 | [
"MIT"
] | null | null | null | from pydantic import BaseSettings
settings = Settings()
| 17 | 49 | 0.694118 | from pydantic import BaseSettings
class Settings(BaseSettings):
db_args: str = '{"check_same_thread": false}'
db_url: str = "sqlite://"
settings = Settings()
| 0 | 88 | 23 |
31661dcae05a2f022eb046592b8462f690591281 | 2,292 | py | Python | configs/defaults.py | steermomo/WSI_extract | 9db3bca2e59617a244c0f09d05146bfb44fb96e7 | [
"Apache-2.0"
] | null | null | null | configs/defaults.py | steermomo/WSI_extract | 9db3bca2e59617a244c0f09d05146bfb44fb96e7 | [
"Apache-2.0"
] | null | null | null | configs/defaults.py | steermomo/WSI_extract | 9db3bca2e59617a244c0f09d05146bfb44fb96e7 | [
"Apache-2.0"
] | null | null | null | from yacs.yacs_config import CfgNode as CN
import os.path as osp
# https://github.com/rbgirshick/yacs
_C = CN()
_C.DEST_EXT = "png"
_C.SAVE_PATCH = False
_C.SLIDE = CN()
_C.SLIDE.BASE_DIR = ''
_C.SLIDE.SCALE_FACTOR = 32
_C.SLIDE.DEST_DIR = ''
_C.SLIDE.THUMBNAIL_SIZE = 300
_C.SLIDE.THUMBNAIL_EXT = "... | 36.380952 | 136 | 0.739965 | from yacs.yacs_config import CfgNode as CN
import os.path as osp
# https://github.com/rbgirshick/yacs
_C = CN()
_C.DEST_EXT = "png"
_C.SAVE_PATCH = False
_C.SLIDE = CN()
_C.SLIDE.BASE_DIR = ''
_C.SLIDE.SCALE_FACTOR = 32
_C.SLIDE.DEST_DIR = ''
_C.SLIDE.THUMBNAIL_SIZE = 300
_C.SLIDE.THUMBNAIL_EXT = "... | 0 | 0 | 0 |
d47cbe27ecf0fb6e8635ad04dd50e38f99641579 | 161 | py | Python | conf/__init__.py | huzidabanzhang/Python | 7b304290e5be7db4bce253edb069a12dcbc3c998 | [
"MIT"
] | 4 | 2019-09-04T09:16:24.000Z | 2019-09-18T08:50:36.000Z | conf/__init__.py | huzidabanzhang/Python | 7b304290e5be7db4bce253edb069a12dcbc3c998 | [
"MIT"
] | null | null | null | conf/__init__.py | huzidabanzhang/Python | 7b304290e5be7db4bce253edb069a12dcbc3c998 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:UTF-8 -*-
'''
@Description:
@Author: Zpp
@Date: 2019-09-02 16:04:11
@LastEditTime: 2019-09-12 11:27:19
@LastEditors: Zpp
'''
| 16.1 | 34 | 0.639752 | #!/usr/bin/env python
# -*- coding:UTF-8 -*-
'''
@Description:
@Author: Zpp
@Date: 2019-09-02 16:04:11
@LastEditTime: 2019-09-12 11:27:19
@LastEditors: Zpp
'''
| 0 | 0 | 0 |
62ec8d0542517cad4cae583dfc537c1e0c54fc31 | 2,339 | py | Python | sstcam_sandbox/old/charge_resolution_tfwf/extract_average_vs_amplitude.py | watsonjj/CHECLabPySB | 91330d3a6f510a392f635bd7f4abd2f77871322c | [
"BSD-3-Clause"
] | null | null | null | sstcam_sandbox/old/charge_resolution_tfwf/extract_average_vs_amplitude.py | watsonjj/CHECLabPySB | 91330d3a6f510a392f635bd7f4abd2f77871322c | [
"BSD-3-Clause"
] | null | null | null | sstcam_sandbox/old/charge_resolution_tfwf/extract_average_vs_amplitude.py | watsonjj/CHECLabPySB | 91330d3a6f510a392f635bd7f4abd2f77871322c | [
"BSD-3-Clause"
] | 1 | 2021-03-30T09:46:56.000Z | 2021-03-30T09:46:56.000Z | import argparse
import os
import re
from argparse import ArgumentDefaultsHelpFormatter as Formatter
import numpy as np
from tqdm import tqdm
from CHECLabPy.core.io import ReaderR1
from CHECLabPy.utils.waveform import get_average_wf_per_pixel
if __name__ == '__main__':
main()
| 32.041096 | 79 | 0.645575 | import argparse
import os
import re
from argparse import ArgumentDefaultsHelpFormatter as Formatter
import numpy as np
from tqdm import tqdm
from CHECLabPy.core.io import ReaderR1
from CHECLabPy.utils.waveform import get_average_wf_per_pixel
def commonsuffix(files):
reveresed = [f[::-1] for f in files]
return... | 1,961 | 0 | 92 |
2f7d9b5ca25e01d39889eb55e38edcc9ca99bb5e | 8,401 | py | Python | gramtools/tests/commands/build/test_vcf_to_prg_string.py | bricoletc/gramtools | 1ce06178b7b26f42d72e47d3d7b8a7a606e6f256 | [
"MIT"
] | null | null | null | gramtools/tests/commands/build/test_vcf_to_prg_string.py | bricoletc/gramtools | 1ce06178b7b26f42d72e47d3d7b8a7a606e6f256 | [
"MIT"
] | null | null | null | gramtools/tests/commands/build/test_vcf_to_prg_string.py | bricoletc/gramtools | 1ce06178b7b26f42d72e47d3d7b8a7a606e6f256 | [
"MIT"
] | null | null | null | """
Tested behaviour:
* Overlapping vcf records (same CHROM, same POS): the first is kept, the rest is ignored
* Fasta records with no variation: they are output to the prg string in the order seen in the input fasta.
* Adjacent records: site markers placed adjacent to each other,
* Allele markers: in ... | 39.257009 | 113 | 0.672063 | """
Tested behaviour:
* Overlapping vcf records (same CHROM, same POS): the first is kept, the rest is ignored
* Fasta records with no variation: they are output to the prg string in the order seen in the input fasta.
* Adjacent records: site markers placed adjacent to each other,
* Allele markers: in ... | 5,253 | 915 | 272 |
e023985c99cf34d89a2c2a11c3c80c40ada6e2f5 | 7,091 | py | Python | shot-tracking.py | raysinensis/Hot-Cold-Hand | 95b5f756429a75f655d0a2f270486bae86172a1c | [
"MIT"
] | null | null | null | shot-tracking.py | raysinensis/Hot-Cold-Hand | 95b5f756429a75f655d0a2f270486bae86172a1c | [
"MIT"
] | null | null | null | shot-tracking.py | raysinensis/Hot-Cold-Hand | 95b5f756429a75f655d0a2f270486bae86172a1c | [
"MIT"
] | null | null | null | import sys
import datetime
import requests
import json
import glob
import re
import numpy as np
import os
import csv
DATAPATH='C:/NBA'
url_base='http://data.nba.com/5s/json/cms/noseason/scoreboard/%s/games.json'
get_season(2015,dateprocess("10/27/2015"),dateprocess("4/13/2016"))
teamlist=["ATL","BKN... | 28.708502 | 191 | 0.597095 | import sys
import datetime
import requests
import json
import glob
import re
import numpy as np
import os
import csv
DATAPATH='C:/NBA'
url_base='http://data.nba.com/5s/json/cms/noseason/scoreboard/%s/games.json'
def get_season(seasonnum,startd,endd):
datelist=[]
numberd= (endd-startd).days
for i ... | 5,951 | 0 | 251 |
e4395ee2c03d230d6fd5b925d6c6f30f4c5cce2c | 907 | py | Python | lcm/examples/python/listener_select.py | RX-00/monopod | faf59a765db029423402ed1a2b4ab137c6242c9e | [
"MIT"
] | null | null | null | lcm/examples/python/listener_select.py | RX-00/monopod | faf59a765db029423402ed1a2b4ab137c6242c9e | [
"MIT"
] | null | null | null | lcm/examples/python/listener_select.py | RX-00/monopod | faf59a765db029423402ed1a2b4ab137c6242c9e | [
"MIT"
] | null | null | null | # This example demonstrates how to use LCM with the Python select module
import select
import lcm
from exlcm import example_t
lc = lcm.LCM()
lc.subscribe("EXAMPLE", my_handler)
try:
timeout = 1.5 # amount of time to wait, in seconds
while True:
rfds, wfds, efds = select.select([lc.fileno()], [], [],... | 29.258065 | 72 | 0.596472 | # This example demonstrates how to use LCM with the Python select module
import select
import lcm
from exlcm import example_t
def my_handler(channel, data):
msg = example_t.decode(data)
print("Received message on channel \"%s\"" % channel)
print(" timestamp = %s" % str(msg.timestamp))
print(" po... | 420 | 0 | 23 |
3a6660e6775f18793493014c8b61bbe43eae4150 | 5,718 | py | Python | split/db_split.py | duyunhe/vehAnalysis | a3788c3851b786683ed11a3b2f88dc7502a163d3 | [
"Apache-2.0"
] | 1 | 2020-05-26T11:13:17.000Z | 2020-05-26T11:13:17.000Z | split/db_split.py | duyunhe/vehAnalysis | a3788c3851b786683ed11a3b2f88dc7502a163d3 | [
"Apache-2.0"
] | null | null | null | split/db_split.py | duyunhe/vehAnalysis | a3788c3851b786683ed11a3b2f88dc7502a163d3 | [
"Apache-2.0"
] | 1 | 2021-06-24T13:13:00.000Z | 2021-06-24T13:13:00.000Z | # -*- coding: utf-8 -*-
# @Time : 2019/9/6 15:46
# @Author :
# @简介 :
# @File : db_split.py
import cx_Oracle
from collections import defaultdict
import os
from copy import copy
from time import clock
from datetime import datetime, timedelta
from meter_analysis import get_meter_data, get_offset
from trace_m ... | 30.414894 | 112 | 0.581322 | # -*- coding: utf-8 -*-
# @Time : 2019/9/6 15:46
# @Author :
# @简介 :
# @File : db_split.py
import cx_Oracle
from collections import defaultdict
import os
from copy import copy
from time import clock
from datetime import datetime, timedelta
from meter_analysis import get_meter_data, get_offset
from trace_m ... | 4,947 | 2 | 231 |
ff2eb532bc319fdcfea00d8ae7af0269a34d67a0 | 1,582 | py | Python | com_duration.py | juliaknodel/standup-bot | 19cd081c8ce0a75c45d3cf58efa9914e9b6dfb46 | [
"Apache-2.0"
] | 4 | 2020-03-26T17:38:09.000Z | 2020-05-28T18:40:19.000Z | com_duration.py | juliaknodel/standup-bot | 19cd081c8ce0a75c45d3cf58efa9914e9b6dfb46 | [
"Apache-2.0"
] | 64 | 2020-03-26T16:58:28.000Z | 2020-06-04T20:47:43.000Z | com_duration.py | juliaknodel/standup-bot | 19cd081c8ce0a75c45d3cf58efa9914e9b6dfb46 | [
"Apache-2.0"
] | 6 | 2020-03-26T17:39:34.000Z | 2020-05-02T16:06:57.000Z | from exception import BotUserException
from user_input import is_integer_number
from team import is_owner
from team import get_team_db_id
from team import db_teams
| 39.55 | 103 | 0.695322 | from exception import BotUserException
from user_input import is_integer_number
from team import is_owner
from team import get_team_db_id
from team import db_teams
def com_duration(update, context):
try:
user_chat_id = update.effective_chat.id
team_db_id, err_message = get_team_db_id(user_chat_id)... | 1,506 | 0 | 46 |
15cbf906addbaeee34d6903b92c264e18d054cab | 402 | py | Python | classifieds/api/permissions.py | thenils/classx_rest | 89593f0501c42af6b3be5e070ae006a8344c1970 | [
"MIT"
] | null | null | null | classifieds/api/permissions.py | thenils/classx_rest | 89593f0501c42af6b3be5e070ae006a8344c1970 | [
"MIT"
] | null | null | null | classifieds/api/permissions.py | thenils/classx_rest | 89593f0501c42af6b3be5e070ae006a8344c1970 | [
"MIT"
] | null | null | null | from rest_framework.permissions import BasePermission, SAFE_METHODS
class IsPosterOrReadOnly(BasePermission):
"""
The request is authenticated as a poster(the one who posted the item), or is a read-only request.
"""
| 28.714286 | 101 | 0.679104 | from rest_framework.permissions import BasePermission, SAFE_METHODS
class IsPosterOrReadOnly(BasePermission):
"""
The request is authenticated as a poster(the one who posted the item), or is a read-only request.
"""
def has_object_permission(self, request, view, obj):
return bool(
... | 145 | 0 | 27 |
a895a0abf92f3fa813d289f3717d726fa429e939 | 6,427 | py | Python | sdl2/ext/algorithms.py | smcv/py-sdl2 | 209095d858b461c6314f7b7b96b2051ec1656d20 | [
"CC0-1.0"
] | 12 | 2022-02-10T17:04:08.000Z | 2022-03-30T21:05:12.000Z | sdl2/ext/algorithms.py | smcv/py-sdl2 | 209095d858b461c6314f7b7b96b2051ec1656d20 | [
"CC0-1.0"
] | 4 | 2022-02-08T14:16:24.000Z | 2022-03-18T01:32:00.000Z | sdl2/ext/algorithms.py | smcv/py-sdl2 | 209095d858b461c6314f7b7b96b2051ec1656d20 | [
"CC0-1.0"
] | 1 | 2022-03-21T22:23:34.000Z | 2022-03-21T22:23:34.000Z | import sys
__all__ = ["liangbarsky", "cohensutherland", "clipline", "point_on_line"]
def cohensutherland(left, top, right, bottom, x1, y1, x2, y2):
"""Clips a line to a rectangular area.
This implements the Cohen-Sutherland line clipping algorithm. ``left``,
``top``, ``right`` and ``bottom`` define the ... | 34.005291 | 79 | 0.541932 | import sys
__all__ = ["liangbarsky", "cohensutherland", "clipline", "point_on_line"]
def cohensutherland(left, top, right, bottom, x1, y1, x2, y2):
"""Clips a line to a rectangular area.
This implements the Cohen-Sutherland line clipping algorithm. ``left``,
``top``, ``right`` and ``bottom`` define the ... | 214 | 0 | 27 |
7cbe0feed9b8f5309e653215d888c0161aeaa6c9 | 368 | py | Python | bourbaki/application/config/__init__.py | bourbaki-py/application | 78e601a51e292d7fd8cf568f203d1abb58f9bd50 | [
"Apache-2.0"
] | null | null | null | bourbaki/application/config/__init__.py | bourbaki-py/application | 78e601a51e292d7fd8cf568f203d1abb58f9bd50 | [
"Apache-2.0"
] | 6 | 2021-10-30T13:38:47.000Z | 2021-10-30T14:12:34.000Z | bourbaki/application/config/__init__.py | bourbaki-py/application | 78e601a51e292d7fd8cf568f203d1abb58f9bd50 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
from .io import load_config, dump_config, register_dump_config, register_load_config
from .io import (
allow_unsafe_yaml,
require_safe_yaml,
ConfigFormat,
LEGAL_CONFIG_EXTENSIONS,
)
from .python import (
is_json_serializable,
UnsafePythonSourceConfig,
PythonConfigNotSerializa... | 23 | 84 | 0.782609 | # coding:utf-8
from .io import load_config, dump_config, register_dump_config, register_load_config
from .io import (
allow_unsafe_yaml,
require_safe_yaml,
ConfigFormat,
LEGAL_CONFIG_EXTENSIONS,
)
from .python import (
is_json_serializable,
UnsafePythonSourceConfig,
PythonConfigNotSerializa... | 0 | 0 | 0 |
cbaa096923733254264ab8f42214bbbb1eb9b48f | 107 | py | Python | Lesson09/readJSON.py | PacktPublishing/Python-Fundamentals | f24569826b1b7f97e3d54630a34ae61110ca12da | [
"MIT"
] | 1 | 2021-04-23T14:01:56.000Z | 2021-04-23T14:01:56.000Z | Lesson09/readJSON.py | PacktPublishing/Python-Fundamentals | f24569826b1b7f97e3d54630a34ae61110ca12da | [
"MIT"
] | null | null | null | Lesson09/readJSON.py | PacktPublishing/Python-Fundamentals | f24569826b1b7f97e3d54630a34ae61110ca12da | [
"MIT"
] | 4 | 2021-06-29T05:57:44.000Z | 2021-09-02T10:14:55.000Z | import json
with open('example.json') as f:
data = json.loads(f.read())
print(data)
print(type(data)) | 15.285714 | 31 | 0.672897 | import json
with open('example.json') as f:
data = json.loads(f.read())
print(data)
print(type(data)) | 0 | 0 | 0 |
4e299c10d1342e51e2568318e5c7b6f54354930e | 4,801 | py | Python | utility/eva_report_to_tables.py | gfrancis-ALElab/Landuse_DL | d655bd3d008533b54113a0d8cb79e7f8e035c2aa | [
"Apache-2.0"
] | null | null | null | utility/eva_report_to_tables.py | gfrancis-ALElab/Landuse_DL | d655bd3d008533b54113a0d8cb79e7f8e035c2aa | [
"Apache-2.0"
] | null | null | null | utility/eva_report_to_tables.py | gfrancis-ALElab/Landuse_DL | d655bd3d008533b54113a0d8cb79e7f8e035c2aa | [
"Apache-2.0"
] | 2 | 2021-08-07T10:16:53.000Z | 2021-12-31T02:30:37.000Z | #!/usr/bin/env python
# Filename: eva_report_to_tables
"""
introduction: convert multiple evaluation reports to tables.
authors: Huang Lingcao
email:huanglingcao@gmail.com
add time: 28 June, 2020
"""
import os,sys
import re
from optparse import OptionParser
import pandas as pd
if __name__ == "__main__":
usag... | 34.292857 | 134 | 0.681108 | #!/usr/bin/env python
# Filename: eva_report_to_tables
"""
introduction: convert multiple evaluation reports to tables.
authors: Huang Lingcao
email:huanglingcao@gmail.com
add time: 28 June, 2020
"""
import os,sys
import re
from optparse import OptionParser
import pandas as pd
def get_tp_fp_fn_etc(six_lines):
... | 3,846 | 0 | 115 |
6748c2c51ea6b7e0b16c28fe51c2c0000a47c343 | 515 | py | Python | linter.py | SublimeLinter/SublimeLinter-phpcs | 4d819a5a50b9a1da92458cbe1f6f0febde8b3219 | [
"MIT"
] | 74 | 2015-03-18T09:47:23.000Z | 2022-01-11T23:45:12.000Z | linter.py | SublimeLinter/SublimeLinter-phpcs | 4d819a5a50b9a1da92458cbe1f6f0febde8b3219 | [
"MIT"
] | 46 | 2015-03-06T10:20:03.000Z | 2021-02-27T22:55:07.000Z | linter.py | SublimeLinter/SublimeLinter-phpcs | 4d819a5a50b9a1da92458cbe1f6f0febde8b3219 | [
"MIT"
] | 20 | 2015-02-25T22:24:20.000Z | 2019-02-15T05:47:27.000Z | from SublimeLinter.lint import ComposerLinter
| 39.615385 | 162 | 0.539806 | from SublimeLinter.lint import ComposerLinter
class Phpcs(ComposerLinter):
cmd = ('phpcs', '--report=emacs', '${args}', '-')
regex = r'^.*:(?P<line>[0-9]+):(?P<col>[0-9]+): (?:(?P<error>error)|(?P<warning>warning)) - (?P<message>(.(?!\(\S+\)$))+)( \((?P<code>\S+)\)$)?' # noqa: E501
defaults = {
'... | 0 | 445 | 23 |
de04d53c45554706db29a56748d8b80b88c81e4e | 2,237 | py | Python | tests/test_base_plugin.py | StarryPy/StarryPy-Historic | b9dbd552b8c4631a5a8e9dda98b7ba447eca59da | [
"WTFPL"
] | 38 | 2015-02-12T11:57:59.000Z | 2018-11-15T16:03:45.000Z | tests/test_base_plugin.py | StarryPy/StarryPy-Historic | b9dbd552b8c4631a5a8e9dda98b7ba447eca59da | [
"WTFPL"
] | 68 | 2015-02-05T23:29:47.000Z | 2017-12-27T08:26:25.000Z | tests/test_base_plugin.py | StarryPy/StarryPy-Historic | b9dbd552b8c4631a5a8e9dda98b7ba447eca59da | [
"WTFPL"
] | 21 | 2015-02-06T18:58:21.000Z | 2017-12-24T20:08:59.000Z | from unittest import TestCase
from base_plugin import BasePlugin
| 27.280488 | 69 | 0.549397 | from unittest import TestCase
from base_plugin import BasePlugin
class BasePluginTestCase(TestCase):
def test_mapping_override_packets_dont_include_base_plugin(self):
base_plugin = BasePlugin()
with self.assertRaises(AttributeError):
base_plugin.overridden_methods
def test_activa... | 2,026 | 14 | 130 |
12dacc9608416397f5f47eac4baf01cbf69f7b08 | 552 | py | Python | src/bdbd/src/bdbd/test/tfwho_test.py | rkent/BDBD | c5d391da84faf5607c443078781f8b4e1c017dd5 | [
"MIT"
] | null | null | null | src/bdbd/src/bdbd/test/tfwho_test.py | rkent/BDBD | c5d391da84faf5607c443078781f8b4e1c017dd5 | [
"MIT"
] | null | null | null | src/bdbd/src/bdbd/test/tfwho_test.py | rkent/BDBD | c5d391da84faf5607c443078781f8b4e1c017dd5 | [
"MIT"
] | null | null | null | #!/usr/bin/python2
# Send a face to be recognized. This is a ros node. First run node tfwho.
import rospy
import numpy as np
import logging
from cv_bridge import CvBridge
if __name__ == '__main__':
main() | 24 | 78 | 0.686594 | #!/usr/bin/python2
# Send a face to be recognized. This is a ros node. First run node tfwho.
import rospy
import numpy as np
import logging
from cv_bridge import CvBridge
def main():
bridge = CvBridge()
logging.basicConfig(level='DEBUG')
rospy.init_node('tfwho_test')
# get the test image
data = n... | 319 | 0 | 23 |
c86484dd5e1559e6ee2688542d101e2985ae581b | 2,332 | py | Python | pysnmp/Fore-Errors-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Fore-Errors-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Fore-Errors-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Fore-Errors-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Fore-Errors-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:03:25 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | 101.391304 | 477 | 0.786021 | #
# PySNMP MIB module Fore-Errors-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Fore-Errors-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:03:25 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | 0 | 0 | 0 |
73959a40ae9e944f5f759c6487810b567527f1b3 | 215 | py | Python | make_file.py | BinayakJha/File-Manager | 8276f5f8064ae36e8d339dd0482eee7f33e90e2f | [
"MIT"
] | 1 | 2021-10-07T12:02:02.000Z | 2021-10-07T12:02:02.000Z | make_file.py | BinayakJha/File-Manager | 8276f5f8064ae36e8d339dd0482eee7f33e90e2f | [
"MIT"
] | null | null | null | make_file.py | BinayakJha/File-Manager | 8276f5f8064ae36e8d339dd0482eee7f33e90e2f | [
"MIT"
] | null | null | null | import os
import shutil | 30.714286 | 53 | 0.688372 | import os
import shutil
def make_files(file11,folder,name,file1):
if not os.path.isdir(os.path.join(folder, name)):
os.mkdir(os.path.join(folder,name))
shutil.move(file11, folder+"/"+name+"/"+file1) | 170 | 0 | 22 |
f8dc1f66414fb0bc7bea446729e1e32774bbe206 | 9,697 | py | Python | vehicle.py | jmgraeffe/gtao_python_wrapper | f1a50fa045a22e1c6e48ee863e19eb5606c1dbd5 | [
"MIT"
] | 2 | 2020-10-26T11:19:39.000Z | 2020-10-26T11:19:41.000Z | vehicle.py | jmgraeffe/gtao_python_wrapper | f1a50fa045a22e1c6e48ee863e19eb5606c1dbd5 | [
"MIT"
] | 3 | 2017-04-04T15:49:03.000Z | 2017-04-04T16:18:27.000Z | vehicle.py | j0nnib0y/gtao_python_wrapper | f1a50fa045a22e1c6e48ee863e19eb5606c1dbd5 | [
"MIT"
] | null | null | null | """Python wrapper for GTA Orange's vehicle functions
Subscribable built-in events:
+===============+=========================+====================================+
| name | vehicle-local arguments | global arguments |
+===============+=========================+===============================... | 28.860119 | 106 | 0.536351 | """Python wrapper for GTA Orange's vehicle functions
Subscribable built-in events:
+===============+=========================+====================================+
| name | vehicle-local arguments | global arguments |
+===============+=========================+===============================... | 565 | 0 | 46 |
f41b9fb80b4ff672062a4bfd688127d80210b108 | 1,133 | py | Python | yatube/users/views.py | kotofey97/yatube_project_finale | 01a11edd771035f961eecfd8dbf0dc004cee537d | [
"MIT"
] | 3 | 2021-10-07T14:11:32.000Z | 2021-12-07T12:23:53.000Z | yatube/users/views.py | kotofey97/yatube_project_finale | 01a11edd771035f961eecfd8dbf0dc004cee537d | [
"MIT"
] | null | null | null | yatube/users/views.py | kotofey97/yatube_project_finale | 01a11edd771035f961eecfd8dbf0dc004cee537d | [
"MIT"
] | null | null | null | from django.contrib.auth.forms import SetPasswordForm
from django.contrib.auth.views import (PasswordChangeView,
PasswordResetConfirmView,
PasswordResetView)
from django.urls import reverse_lazy
from django.views.generic import CreateView
fr... | 34.333333 | 70 | 0.753751 | from django.contrib.auth.forms import SetPasswordForm
from django.contrib.auth.views import (PasswordChangeView,
PasswordResetConfirmView,
PasswordResetView)
from django.urls import reverse_lazy
from django.views.generic import CreateView
fr... | 0 | 648 | 92 |
d323454fe03c0cba22924db01e7c90206efebe8b | 1,806 | py | Python | external_identifier.py | mike-k0/wikidata-toolkit | 2c2c77473ca3bc86a0b16d164d1037883428823f | [
"MIT"
] | null | null | null | external_identifier.py | mike-k0/wikidata-toolkit | 2c2c77473ca3bc86a0b16d164d1037883428823f | [
"MIT"
] | null | null | null | external_identifier.py | mike-k0/wikidata-toolkit | 2c2c77473ca3bc86a0b16d164d1037883428823f | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
def imdb_id(title):
"""IMDB identifier
>>> imdb_id("Inception")
'tt1375666'
>>> imdb_id("Interstellar")
'tt0816692'
"""
web_text = requests.get(f"https://www.imdb.com/find?q={title}").text
soup = BeautifulSoup(web_text, "html.parser")
c... | 23.763158 | 90 | 0.66113 | import requests
from bs4 import BeautifulSoup
def imdb_id(title):
"""IMDB identifier
>>> imdb_id("Inception")
'tt1375666'
>>> imdb_id("Interstellar")
'tt0816692'
"""
web_text = requests.get(f"https://www.imdb.com/find?q={title}").text
soup = BeautifulSoup(web_text, "html.parser")
c... | 0 | 0 | 0 |
f4af1609246d8b34742420dd198deb76f1efe5e3 | 5,609 | py | Python | clients/python-client/swagger_client/api/default_api.py | mayple/versed | 3faad90799b886a8f3728852be36677b8b7b75e5 | [
"MIT"
] | null | null | null | clients/python-client/swagger_client/api/default_api.py | mayple/versed | 3faad90799b886a8f3728852be36677b8b7b75e5 | [
"MIT"
] | null | null | null | clients/python-client/swagger_client/api/default_api.py | mayple/versed | 3faad90799b886a8f3728852be36677b8b7b75e5 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Versed conversion API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
i... | 40.064286 | 207 | 0.617579 | # coding: utf-8
"""
Versed conversion API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
i... | 120 | 0 | 27 |