hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6e2c2c7b7815793a7f95c3b44334d1d26f04fcb1 | 219 | py | Python | ex11.py | EiEiKyaw/python-exercise | 63dcc073f55f125de784eb61aa7c82a50ca706ed | [
"MIT"
] | null | null | null | ex11.py | EiEiKyaw/python-exercise | 63dcc073f55f125de784eb61aa7c82a50ca706ed | [
"MIT"
] | null | null | null | ex11.py | EiEiKyaw/python-exercise | 63dcc073f55f125de784eb61aa7c82a50ca706ed | [
"MIT"
] | null | null | null | print("How old are you?", end='')
age=input()
print("How tall are you?", end='')
height=input()
print("How much do you weigh?", end='')
weight=input()
print(f"So, you're {age} old, {height} tall and {weight} heavy.")
| 21.9 | 65 | 0.634703 |
c8a88c03f8c023b08a5d043032d47ea9703409ed | 1,414 | py | Python | tests/rules/test_fab_command_not_found.py | benmonro/therandy | b7c7c4ffc8f82b27f284ba90621a47baa5dfcb03 | [
"MIT"
] | null | null | null | tests/rules/test_fab_command_not_found.py | benmonro/therandy | b7c7c4ffc8f82b27f284ba90621a47baa5dfcb03 | [
"MIT"
] | null | null | null | tests/rules/test_fab_command_not_found.py | benmonro/therandy | b7c7c4ffc8f82b27f284ba90621a47baa5dfcb03 | [
"MIT"
] | null | null | null | import pytest
from therandy.rules.fab_command_not_found import match, get_new_command
from therandy.types import Command
output = '''
Warning: Command(s) not found:
extenson
deloyp
Available commands:
update_config
prepare_extension
Template A string class for supporting $-substitut... | 28.857143 | 78 | 0.701556 |
fd881fda86582169d7365e1513f0cd66a317951b | 12,622 | py | Python | src/train_new.py | AlexHeffner/DropEdge | d981b779be330d5ff4dd557d6db1615391bfc249 | [
"MIT"
] | 380 | 2019-10-09T16:18:52.000Z | 2022-03-23T11:47:18.000Z | src/train_new.py | AlexHeffner/DropEdge | d981b779be330d5ff4dd557d6db1615391bfc249 | [
"MIT"
] | 16 | 2019-10-17T16:47:50.000Z | 2022-03-04T13:02:32.000Z | src/train_new.py | AlexHeffner/DropEdge | d981b779be330d5ff4dd557d6db1615391bfc249 | [
"MIT"
] | 72 | 2019-10-13T08:03:37.000Z | 2022-03-24T21:42:24.000Z | from __future__ import division
from __future__ import print_function
import time
import argparse
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from tensorboardX import SummaryWriter
from earlystopping import EarlyStopping
from sample import Sampler
from me... | 41.794702 | 160 | 0.647599 |
37e6d298051012d51666f79b2be000c3221dd38b | 815 | py | Python | root/os/DSAA/DataStructuresAndAlgorithms/python/chutils/chutils/chsocket/__init__.py | chyidl/chyidlTutorial | a033e0a57abf84fdbb61e57736822f9126db6ff7 | [
"MIT"
] | 5 | 2018-10-17T05:57:39.000Z | 2021-07-05T15:38:24.000Z | root/os/DSAA/DataStructuresAndAlgorithms/python/chutils/chutils/chsocket/__init__.py | chyidl/chyidlTutorial | a033e0a57abf84fdbb61e57736822f9126db6ff7 | [
"MIT"
] | 2 | 2021-04-14T00:48:43.000Z | 2021-04-14T02:20:50.000Z | root/os/DSAA/DataStructuresAndAlgorithms/python/chutils/chutils/chsocket/__init__.py | chyidl/chyidlTutorial | a033e0a57abf84fdbb61e57736822f9126db6ff7 | [
"MIT"
] | 3 | 2019-03-02T14:36:19.000Z | 2022-03-18T10:12:09.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# __init__.py
# chsocket
#
# 🎂"Here's to the crazy ones. The misfits. The rebels.
# The troublemakers. The round pegs in the square holes.
# The ones who see things differently. They're not found
# of rules. And they have no respect for the status quo.
# You can quote ... | 29.107143 | 66 | 0.716564 |
6e3a434dba5b6c794fe419e74c035a1677db95b6 | 287 | py | Python | ex011 - area parede.py | fblaz/Python-ex---curso-em-video | 794d1f7b9fa0803b168aaf973007906b66a02e2d | [
"MIT"
] | null | null | null | ex011 - area parede.py | fblaz/Python-ex---curso-em-video | 794d1f7b9fa0803b168aaf973007906b66a02e2d | [
"MIT"
] | null | null | null | ex011 - area parede.py | fblaz/Python-ex---curso-em-video | 794d1f7b9fa0803b168aaf973007906b66a02e2d | [
"MIT"
] | null | null | null | larg = float(input('largura da parede em metros: '))
alt = float(input('altura da parde em metros '))
rend = 2 # rendimento de 2m2 por litro de tinta
area = larg*alt
tinta = area/rend
print(f'a area é de {area} m2 \n'
f'será necessário comprar {tinta:.2f} litros de tinta') | 41 | 61 | 0.672474 |
0414778e36eb738ff3c83eb64b793b974e632049 | 21,642 | py | Python | libopenzwave/_global.py | Julian/libopenzwave-cffi | 7683e5e4e08270dd7d780ab6a0ccd048343b08e1 | [
"MIT"
] | 1 | 2018-03-17T18:44:11.000Z | 2018-03-17T18:44:11.000Z | libopenzwave/_global.py | Julian/libopenzwave-cffi | 7683e5e4e08270dd7d780ab6a0ccd048343b08e1 | [
"MIT"
] | null | null | null | libopenzwave/_global.py | Julian/libopenzwave-cffi | 7683e5e4e08270dd7d780ab6a0ccd048343b08e1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
.. module:: libopenzwave
This file is part of **python-openzwave** project https://github.com/OpenZWave/python-openzwave.
:platform: Unix, Windows, MacOS X
:sinopsis: openzwave C++
.. moduleauthor: bibi21000 aka Sebastien GALLET <bibi21000@gmail.com>
.. moduleauthor: Maarten Damen <m.dam... | 41.860735 | 331 | 0.681776 |
a600d7c8d8c6f43756f0cea6f0b34463826860e7 | 2,671 | py | Python | tests/test_agent.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 6 | 2020-10-15T14:45:11.000Z | 2021-02-20T12:11:32.000Z | tests/test_agent.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 5 | 2021-01-20T15:34:29.000Z | 2022-03-18T18:52:53.000Z | tests/test_agent.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 2 | 2021-01-11T18:48:49.000Z | 2021-01-26T15:45:38.000Z | """Tests agent related functionality"""
import pytest
from gym_gridverse.agent import Agent
from gym_gridverse.geometry import Area, Orientation, Position
@pytest.mark.parametrize(
'position,orientation,expected',
[
(Position(0, 0), Orientation.N, Area((-6, 0), (-3, 3))),
(Position(0, 0), O... | 36.094595 | 75 | 0.60614 |
53ece3482bd612b9e86dd34ddffbfb2623d7f344 | 710 | py | Python | rest_api/config/urls.py | Razz21/Nuxt-Django-E-Commerce-Demo | 24834007f7554f9e59758b611c73ea0da85c841e | [
"MIT"
] | 1 | 2020-10-31T12:46:17.000Z | 2020-10-31T12:46:17.000Z | rest_api/config/urls.py | Razz21/Nuxt-Django-E-Commerce-Demo | 24834007f7554f9e59758b611c73ea0da85c841e | [
"MIT"
] | 2 | 2020-07-25T11:01:46.000Z | 2022-01-22T10:39:02.000Z | rest_api/config/urls.py | Razz21/Nuxt-Django-E-Commerce-Demo | 24834007f7554f9e59758b611c73ea0da85c841e | [
"MIT"
] | null | null | null | from django.urls import path, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
# todo api-root-url
urlpatterns = [
path("admin/", admin.site.urls),
path("api/auth/", include("project.users.urls")),
path("api/", include("project.core.urls... | 29.583333 | 85 | 0.735211 |
b25e8d05359813a7e9389c5bf5860101614a2bc0 | 9,413 | py | Python | guild/op_cmd.py | timt51/guildai | 8d3aa9b902e29eb60ebbb408b3a1cbd3f40fcaec | [
"Apache-2.0"
] | 694 | 2018-11-30T01:06:30.000Z | 2022-03-31T14:46:26.000Z | guild/op_cmd.py | timt51/guildai | 8d3aa9b902e29eb60ebbb408b3a1cbd3f40fcaec | [
"Apache-2.0"
] | 323 | 2018-11-05T17:44:34.000Z | 2022-03-31T16:56:41.000Z | guild/op_cmd.py | timt51/guildai | 8d3aa9b902e29eb60ebbb408b3a1cbd3f40fcaec | [
"Apache-2.0"
] | 68 | 2019-04-01T04:24:47.000Z | 2022-02-24T17:22:04.000Z | # Copyright 2017-2021 TensorHub, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 29.142415 | 86 | 0.645065 |
039b76ad98bd636c2b42ba7b44acbd5d4c85d682 | 1,649 | py | Python | dkist/utils/sysinfo.py | DKISTDC/dkist | 3b97d7c0db144a717cfbe648b7402b8b8f9f2da2 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 21 | 2018-05-18T13:43:59.000Z | 2022-03-16T21:17:39.000Z | dkist/utils/sysinfo.py | Cadair/dkist | 2f4d930ea0e002db40e8ef17a79b0b4fb2e6d3f3 | [
"BSD-3-Clause"
] | 134 | 2017-12-07T16:09:24.000Z | 2022-03-17T16:13:55.000Z | dkist/utils/sysinfo.py | Cadair/dkist | 2f4d930ea0e002db40e8ef17a79b0b4fb2e6d3f3 | [
"BSD-3-Clause"
] | 4 | 2017-12-04T10:49:49.000Z | 2022-01-10T12:20:46.000Z | import platform
from pkg_resources import get_distribution
from sunpy.extern.distro import linux_distribution
from sunpy.util.sysinfo import find_dependencies
__all__ = ['system_info']
def system_info():
"""
Display information about your system for submitting bug reports.
"""
base_reqs = get_distr... | 35.085106 | 84 | 0.597332 |
5b8932362dae9cb287b2a635972f66f141fcf3fd | 3,541 | py | Python | python/oneflow/test/modules/test_nonzero.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_nonzero.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_nonzero.py | butterluo/oneflow | cf2ce575d80f89642b71bee2248e69b09213007d | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 38.075269 | 140 | 0.694719 |
228161ea7cc2cf2d04f4dbe753d2c23160c414ee | 3,096 | py | Python | main.py | CuteFwan/b_test | 8aca45673b0c95238a72a14c466b77a06458a887 | [
"MIT"
] | null | null | null | main.py | CuteFwan/b_test | 8aca45673b0c95238a72a14c466b77a06458a887 | [
"MIT"
] | null | null | null | main.py | CuteFwan/b_test | 8aca45673b0c95238a72a14c466b77a06458a887 | [
"MIT"
] | null | null | null | from b_test import *
import random
def setupgamerandomly(game):
"""
Randomly places boats on a game's board.
Keeps trying until all boats fit.
Need to add a timeout if the board gets into a configuration
where no more boats can fit, but this isn't necessary for standard
battleships.
Param... | 29.207547 | 132 | 0.561047 |
282073aa1c4c6bed4139f59d2344df6d9bf53642 | 785 | py | Python | main.py | barthap/BPMN | 43dae78ba9e47015267b382d596cb2afbe7d6a35 | [
"MIT"
] | null | null | null | main.py | barthap/BPMN | 43dae78ba9e47015267b382d596cb2afbe7d6a35 | [
"MIT"
] | null | null | null | main.py | barthap/BPMN | 43dae78ba9e47015267b382d596cb2afbe7d6a35 | [
"MIT"
] | null | null | null | import examples
import matplotlib.pyplot as plt
if __name__ == '__main__':
print('Hello!')
# examples.lab1_repair_example() # OK
# examples.lab2_example() # OK
# examples.lab2_ex1() # OK
# examples.lab2_ex2() # OK
for i in range(1, 10):
... | 16.354167 | 48 | 0.464968 |
e5ead09d1ff6100d64e6861f41eb66b0f5e4b482 | 10,561 | py | Python | Thirdparty/libuv/build.py | stinvi/dava.engine | 2b396ca49cdf10cdc98ad8a9ffcf7768a05e285e | [
"BSD-3-Clause"
] | 26 | 2018-09-03T08:48:22.000Z | 2022-02-14T05:14:50.000Z | Thirdparty/libuv/build.py | ANHELL-blitz/dava.engine | ed83624326f000866e29166c7f4cccfed1bb41d4 | [
"BSD-3-Clause"
] | null | null | null | Thirdparty/libuv/build.py | ANHELL-blitz/dava.engine | ed83624326f000866e29166c7f4cccfed1bb41d4 | [
"BSD-3-Clause"
] | 45 | 2018-05-11T06:47:17.000Z | 2022-02-03T11:30:55.000Z | import os
import shutil
import build_utils
import build_config
def get_supported_targets(platform):
if platform == 'win32':
return ['win32']
elif platform == 'darwin':
return ['macos', 'ios', 'android']
elif platform == 'linux':
return ['android', 'linux']
else:
return ... | 37.05614 | 107 | 0.719061 |
01d39ab22e2a89bb3379226cd92c2224a127080f | 462 | py | Python | openapi_schema_validator/__init__.py | jparise/openapi-schema-validator | a1e3459d2013b622b10fcdcd743fff01f0b67fad | [
"BSD-3-Clause"
] | 1 | 2021-05-20T12:52:56.000Z | 2021-05-20T12:52:56.000Z | openapi_schema_validator/__init__.py | jparise/openapi-schema-validator | a1e3459d2013b622b10fcdcd743fff01f0b67fad | [
"BSD-3-Clause"
] | 3 | 2021-08-30T16:30:50.000Z | 2022-03-01T23:15:44.000Z | openapi_schema_validator/__init__.py | jparise/openapi-schema-validator | a1e3459d2013b622b10fcdcd743fff01f0b67fad | [
"BSD-3-Clause"
] | 3 | 2021-05-21T21:26:34.000Z | 2021-10-05T16:57:57.000Z | # -*- coding: utf-8 -*-
from openapi_schema_validator._format import oas30_format_checker
from openapi_schema_validator.shortcuts import validate
from openapi_schema_validator.validators import OAS30Validator
__author__ = 'Artur Maciag'
__email__ = 'maciag.artur@gmail.com'
__version__ = '0.1.4'
__url__ = 'https://gith... | 35.538462 | 65 | 0.796537 |
24fe389318d44980ad45b766875022a99635b325 | 614 | py | Python | src/main.py | Yasushi-Shinohara/CrystalLewenstein | 5dde921f067269b41fbef31f2422c92eb8e2301b | [
"MIT"
] | null | null | null | src/main.py | Yasushi-Shinohara/CrystalLewenstein | 5dde921f067269b41fbef31f2422c92eb8e2301b | [
"MIT"
] | null | null | null | src/main.py | Yasushi-Shinohara/CrystalLewenstein | 5dde921f067269b41fbef31f2422c92eb8e2301b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding: UTF-8
# This is created 2020/06/08 by Y. Shinohara
# This is lastly modified 2020/06/08 by Y. Shinohara #This part is highly doubtable because of my lazyness
import time
ts = time.time()
from modules.print_funcs import print_header, print_footer, print_midtime, print_endtime
from modules.fun... | 21.928571 | 106 | 0.773616 |
33a85dc564074ead71cba7fa188bd0cc3b6cc96f | 669 | py | Python | examples/discover.py | nilsbeck/pytheos | de4f3a03330ddb28e68ddcaa7b4888ea9a25e238 | [
"MIT"
] | null | null | null | examples/discover.py | nilsbeck/pytheos | de4f3a03330ddb28e68ddcaa7b4888ea9a25e238 | [
"MIT"
] | 1 | 2021-10-30T16:31:41.000Z | 2021-10-30T16:31:41.000Z | examples/discover.py | nilsbeck/pytheos | de4f3a03330ddb28e68ddcaa7b4888ea9a25e238 | [
"MIT"
] | 1 | 2021-10-30T14:24:58.000Z | 2021-10-30T14:24:58.000Z | #!/usr/bin/env python
"""
This example demonstrates how to use SSDP to discover HEOS devices on your network.
"""
import os
import sys
import asyncio
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import pytheos
import pytheos.utils
DISCOVERY_TIMEOUT = 3
async def main():
services = await pytheo... | 21.580645 | 83 | 0.692078 |
e8967d6e439b1daa3735932ea5fc72c0d3652bd5 | 3,817 | py | Python | Source/Python/imuDataManipulator.py | JonathanSolvesProblems/Motion-Capture-Hand | b4352d23196d5eabb3df0e97cd0b03eb0fe093ad | [
"MIT"
] | null | null | null | Source/Python/imuDataManipulator.py | JonathanSolvesProblems/Motion-Capture-Hand | b4352d23196d5eabb3df0e97cd0b03eb0fe093ad | [
"MIT"
] | null | null | null | Source/Python/imuDataManipulator.py | JonathanSolvesProblems/Motion-Capture-Hand | b4352d23196d5eabb3df0e97cd0b03eb0fe093ad | [
"MIT"
] | null | null | null | import serial
import bpy
import mathutils
from time import *
class ImuDataManipulator:
def __init__(self, port = 'com3', baud = 115200, scene_mode = '', rot_mode = '', armatureName = '', boneName = '', boneFingerNames = []):
self.port = port
self.baud = baud
self.scene_mode = scene_mode
... | 43.375 | 141 | 0.650511 |
4a32fe4a0fe811b44e915b06de1a8de6ca673b16 | 2,108 | py | Python | test_lib/pseudo_files_db.py | amotus/oe-pseudo-test-env | b9ae7f7ceb265f33b4f70938389a11bf2af41aed | [
"Apache-2.0"
] | null | null | null | test_lib/pseudo_files_db.py | amotus/oe-pseudo-test-env | b9ae7f7ceb265f33b4f70938389a11bf2af41aed | [
"Apache-2.0"
] | null | null | null | test_lib/pseudo_files_db.py | amotus/oe-pseudo-test-env | b9ae7f7ceb265f33b4f70938389a11bf2af41aed | [
"Apache-2.0"
] | null | null | null |
import sqlite3
from contextlib import closing
from dataclasses import dataclass
from typing import Iterator, Tuple, Any, Optional
from pathlib import Path
@dataclass
class PseudoFilesDbRow:
id: int
path: Path
dev: int
ino: int
uid: int
gid: int
mode: int
rdev: int
deleting: int
... | 23.954545 | 66 | 0.610057 |
ebb5f52b866500805274837d4adcf73883b69e8c | 613 | py | Python | torch/_C/CudaDoubleStorageBase.py | binh-vu/pytorch-stub | 2067c75457c66fd4fd40fde091b5da971f8ea838 | [
"MIT"
] | 21 | 2019-01-25T08:53:51.000Z | 2021-05-29T05:19:57.000Z | torch/_C/CudaDoubleStorageBase.py | binh-vu/pytorch-stub | 2067c75457c66fd4fd40fde091b5da971f8ea838 | [
"MIT"
] | 1 | 2020-11-19T03:22:24.000Z | 2021-03-22T14:48:55.000Z | torch/_C/CudaDoubleStorageBase.py | binh-vu/pytorch-stub | 2067c75457c66fd4fd40fde091b5da971f8ea838 | [
"MIT"
] | 4 | 2019-03-02T05:59:19.000Z | 2019-10-05T11:38:55.000Z | # encoding: utf-8
# module torch._C
# from /Users/rook/anaconda/lib/python3.6/site-packages/torch/_C.cpython-36m-darwin.so
# by generator 1.145
# no doc
# imports
import torch._C._functions as _functions # <module 'torch._C._functions'>
from .object import object
class CudaDoubleStorageBase(object):
# no doc
... | 24.52 | 101 | 0.686786 |
757cec314b6d3d1bf5d7c19eed131a52116ed2aa | 482 | py | Python | algernon/keyboard.py | ZeroMaxinumXZ/albert | ac6eca4a9422a87d0a09c0d2a51278cf51949b90 | [
"MIT"
] | 7 | 2019-03-03T14:41:44.000Z | 2019-03-06T18:37:50.000Z | algernon/keyboard.py | ZeroMaxinumXZ/reinfinity-mouse | ac6eca4a9422a87d0a09c0d2a51278cf51949b90 | [
"MIT"
] | 5 | 2019-03-03T17:55:39.000Z | 2019-03-06T05:37:01.000Z | algernon/keyboard.py | ZeroMaxinumXZ/albert | ac6eca4a9422a87d0a09c0d2a51278cf51949b90 | [
"MIT"
] | null | null | null | def keys():
keys = ['\t', '\n', '\r', ' ', '!', '"', '#', '$', '%', '&', "'", '(',
')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`',
'a', 'b', 'c', 'd', 'e','f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q'... | 53.555556 | 78 | 0.209544 |
92cc8d487f67cd5889ea41187f4b62de90cf9838 | 486 | py | Python | extra_tests/cffi_tests/embedding/add3.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | extra_tests/cffi_tests/embedding/add3.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | extra_tests/cffi_tests/embedding/add3.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | # Generated by pypy/tool/import_cffi.py
import cffi
ffi = cffi.FFI()
ffi.embedding_api("""
int add3(int, int, int, int);
""")
ffi.embedding_init_code(r"""
from _add3_cffi import ffi
import sys
@ffi.def_extern()
def add3(x, y, z, t):
sys.stdout.write("adding %d, %d, %d, %d\n" % (x, y, z, ... | 18.692308 | 66 | 0.578189 |
1f722dce6800b64deeaa36e4f51a706ac5ad0b14 | 2,042 | py | Python | fastapi_contrib/permissions.py | mumtozvalijonov/fastapi_contrib | e35b4fd7c135380f885c364e4d4b992fb55f687e | [
"MIT"
] | 504 | 2019-08-26T18:14:03.000Z | 2022-03-25T13:49:50.000Z | fastapi_contrib/permissions.py | mumtozvalijonov/fastapi_contrib | e35b4fd7c135380f885c364e4d4b992fb55f687e | [
"MIT"
] | 100 | 2019-08-23T07:52:30.000Z | 2022-03-20T06:13:10.000Z | fastapi_contrib/permissions.py | mumtozvalijonov/fastapi_contrib | e35b4fd7c135380f885c364e4d4b992fb55f687e | [
"MIT"
] | 32 | 2019-10-01T12:46:14.000Z | 2022-02-01T13:44:53.000Z | from abc import ABC, abstractmethod
from starlette import status
from starlette.requests import Request
from fastapi_contrib.exceptions import HTTPException
class BasePermission(ABC):
"""
Abstract permission that all other Permissions must be inherited from.
Defines basic error message, status & error ... | 28.760563 | 77 | 0.669442 |
191c403529a93807d0ec4731a43ab31cfe53ccca | 17,286 | py | Python | tests/test_loader.py | vergeml/VergeML | 3dc30ba4e0f3d038743b6d468860cbcf3681acc6 | [
"MIT"
] | 324 | 2018-10-28T19:29:47.000Z | 2020-01-24T20:22:07.000Z | tests/test_loader.py | mme/vergeml | 3dc30ba4e0f3d038743b6d468860cbcf3681acc6 | [
"MIT"
] | 8 | 2018-10-30T10:57:19.000Z | 2019-06-05T10:21:30.000Z | tests/test_loader.py | mme/vergeml | 3dc30ba4e0f3d038743b6d468860cbcf3681acc6 | [
"MIT"
] | 19 | 2018-10-29T18:43:03.000Z | 2019-02-21T15:08:41.000Z | """
Tests data loading (cached + direct).
"""
import random
from pathlib import Path
from vergeml.loader import MemoryCachedLoader, LiveLoader, FileCachedLoader
from vergeml.io import SourcePlugin, source, Sample
from vergeml.operation import OperationPlugin, operation
from vergeml.operations.augment import AugmentOp... | 40.672941 | 98 | 0.695476 |
be16002996752adf86c45119f92a9f2237354d26 | 15,626 | py | Python | django_backend/backend/apps.py | holg/django_backend | 6cef76a378664e6621619862e6db476788a58992 | [
"BSD-3-Clause"
] | null | null | null | django_backend/backend/apps.py | holg/django_backend | 6cef76a378664e6621619862e6db476788a58992 | [
"BSD-3-Clause"
] | null | null | null | django_backend/backend/apps.py | holg/django_backend | 6cef76a378664e6621619862e6db476788a58992 | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict
from django.conf.urls import include, url
from django.contrib.auth import get_permission_codename
try: # htr dj3 fix
from django.urls import reverse
except Exception:
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from dja... | 34.801782 | 126 | 0.614233 |
955bc47138927807e0f96a4bf22c1e0aa2c664f6 | 7,916 | py | Python | kubernetes_asyncio/client/models/apps_v1beta1_deployment_rollback.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/apps_v1beta1_deployment_rollback.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/apps_v1beta1_deployment_rollback.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class AppsV1beta... | 34.872247 | 295 | 0.640222 |
b1d70f829e2394c3e3accf2c7dab8d2b55a06f92 | 1,524 | py | Python | insynth/perturbators/__init__.py | mlxyz/insynth | 0d2ad6d6177944978e6d85990b9991a614d75b68 | [
"MIT"
] | null | null | null | insynth/perturbators/__init__.py | mlxyz/insynth | 0d2ad6d6177944978e6d85990b9991a614d75b68 | [
"MIT"
] | 1 | 2021-12-06T20:46:20.000Z | 2021-12-06T20:48:37.000Z | insynth/__init__.py | mlxyz/insynth | 0d2ad6d6177944978e6d85990b9991a614d75b68 | [
"MIT"
] | 1 | 2021-12-06T20:45:50.000Z | 2021-12-06T20:45:50.000Z | # Copyright (c) 2022, Chair of Software Technology
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice, this list of conditi... | 117.230769 | 758 | 0.803806 |
ccfac00df7279754dbbd869e46e7c2d840fa8dc8 | 1,717 | py | Python | pos-directory.py | lothelanor/actib | c19ba559f2d5810e505ce39abf31e21ba212c8e9 | [
"MIT"
] | 7 | 2021-03-23T12:28:59.000Z | 2022-03-02T18:03:34.000Z | pos-directory.py | lothelanor/actib | c19ba559f2d5810e505ce39abf31e21ba212c8e9 | [
"MIT"
] | 2 | 2021-01-08T13:08:47.000Z | 2021-01-12T20:19:07.000Z | pos-directory.py | lothelanor/actib | c19ba559f2d5810e505ce39abf31e21ba212c8e9 | [
"MIT"
] | null | null | null | import pathlib
from datetime import datetime
import glob
import os
import sys
import actibpos
from multiprocessing import Pool
if len(sys.argv) < 2:
print("error: you must pass a directory as argument to the script")
sys.exit(1)
indir = sys.argv[1]
now = datetime.now()
dt = now.strftime("%Y%m%d_%H-%M-%S")
s... | 33.666667 | 119 | 0.665696 |
dfb88ca196f51ff6ce1e08080069487f8855b315 | 393 | py | Python | hitchike/wsgi.py | tgy/hitchike | b73c8714f584eeeb432c7c8df706dd8b944d632c | [
"MIT"
] | 4 | 2016-02-17T21:30:23.000Z | 2016-02-20T11:10:05.000Z | hitchike/wsgi.py | tgy/hitchike | b73c8714f584eeeb432c7c8df706dd8b944d632c | [
"MIT"
] | 10 | 2020-09-14T07:56:53.000Z | 2020-09-14T07:56:55.000Z | hitchike/wsgi.py | tgy/hitchike | b73c8714f584eeeb432c7c8df706dd8b944d632c | [
"MIT"
] | null | null | null | """
WSGI config for hitchike project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
04b07f507d1328bfdb06f27e0620cacfebeadc2d | 1,478 | py | Python | test/knxip_tests/connectionstate_request_test.py | Trance-Paradox/xknx | d5603361080f96aafd19c14d17fb1ff391064b3f | [
"MIT"
] | null | null | null | test/knxip_tests/connectionstate_request_test.py | Trance-Paradox/xknx | d5603361080f96aafd19c14d17fb1ff391064b3f | [
"MIT"
] | null | null | null | test/knxip_tests/connectionstate_request_test.py | Trance-Paradox/xknx | d5603361080f96aafd19c14d17fb1ff391064b3f | [
"MIT"
] | null | null | null | """Unit test for KNX/IP ConnectionStateRequests."""
import pytest
from xknx import XKNX
from xknx.exceptions import CouldNotParseKNXIP
from xknx.knxip import HPAI, ConnectionStateRequest, KNXIPFrame
class TestKNXIPConnectionStateRequest:
"""Test class for KNX/IP ConnectionStateRequests."""
def test_connecti... | 35.190476 | 80 | 0.68065 |
8d224c8754b6b73fd7030601793c536af6b05063 | 1,251 | py | Python | activitysim/abm/models/summarize.py | mxndrwgrdnr/activitysim | 722d6e36b2210d5d24dfa2ac4a3504c1e8f75336 | [
"BSD-3-Clause"
] | 85 | 2018-02-16T15:08:13.000Z | 2022-03-23T15:08:08.000Z | activitysim/abm/models/summarize.py | mxndrwgrdnr/activitysim | 722d6e36b2210d5d24dfa2ac4a3504c1e8f75336 | [
"BSD-3-Clause"
] | 311 | 2018-01-16T01:59:47.000Z | 2022-03-29T00:46:40.000Z | activitysim/abm/models/summarize.py | mxndrwgrdnr/activitysim | 722d6e36b2210d5d24dfa2ac4a3504c1e8f75336 | [
"BSD-3-Clause"
] | 63 | 2018-02-05T15:27:51.000Z | 2022-03-04T20:36:33.000Z | # ActivitySim
# See full license in LICENSE.txt.
import logging
import sys
import pandas as pd
from activitysim.core import pipeline
from activitysim.core import inject
from activitysim.core import config
from activitysim.core.config import setting
logger = logging.getLogger(__name__)
@inject.step()
def write_summ... | 28.431818 | 111 | 0.665867 |
99d7abd44129a6ae699dc943bb9e0c88fa7866a6 | 1,219 | py | Python | examples/holoclean_repair_example.py | cgebest/holoclean | f3032819d5c5353cfcd340fab9d94f1a0cf63913 | [
"Apache-2.0"
] | null | null | null | examples/holoclean_repair_example.py | cgebest/holoclean | f3032819d5c5353cfcd340fab9d94f1a0cf63913 | [
"Apache-2.0"
] | null | null | null | examples/holoclean_repair_example.py | cgebest/holoclean | f3032819d5c5353cfcd340fab9d94f1a0cf63913 | [
"Apache-2.0"
] | null | null | null | import holoclean
from detect import *
from repair.featurize import *
# 1. Setup a HoloClean session.
hc = holoclean.HoloClean(
db_name='holo',
domain_thresh_1=0.0,
domain_thresh_2=0.0,
weak_label_thresh=0.99,
max_domain=10000,
cor_strength=0.6,
nb_cor_strength=0.8,
weight_decay=0.01,
... | 25.395833 | 69 | 0.709598 |
72d4c064d32319798f10ed1ce27829fa13c0611f | 11,482 | py | Python | models.py | kovrov/wakebreaker | cc9b38351dad5b71d0be913a31202d031e3ff65b | [
"BSD-3-Clause"
] | null | null | null | models.py | kovrov/wakebreaker | cc9b38351dad5b71d0be913a31202d031e3ff65b | [
"BSD-3-Clause"
] | null | null | null | models.py | kovrov/wakebreaker | cc9b38351dad5b71d0be913a31202d031e3ff65b | [
"BSD-3-Clause"
] | null | null | null | import math
import random
import pyglet
from pyglet.gl import *
from util import Vector3
import renderer
import scene
import fx
WORLD_WIDTH = 175
WORLD_HEIGHT = 175
MAX_SPEED = 1.0 # boat's maximum speed
MAX_CHECKPOINTS = 16
class Racer:
def __init__(self, model_manager, model):
# get the... | 33.770588 | 124 | 0.657986 |
c49547479022ec05e10bc4631bee5db686a7a732 | 1,922 | py | Python | benchmark/startPyquil2694.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil2694.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil2694.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=43
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(3) # number=16
prog... | 25.626667 | 64 | 0.566077 |
2d2d5197872f08ac2a198546d6ea64299b7664e0 | 605 | py | Python | users/models.py | DeepinSC/Pikachu-Housing | 453201e19812e356106c071bbf9a306931d14fa7 | [
"Apache-2.0"
] | 1 | 2019-03-23T18:49:31.000Z | 2019-03-23T18:49:31.000Z | users/models.py | DeepinSC/Pikachu-Housing | 453201e19812e356106c071bbf9a306931d14fa7 | [
"Apache-2.0"
] | null | null | null | users/models.py | DeepinSC/Pikachu-Housing | 453201e19812e356106c071bbf9a306931d14fa7 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from department.models import Department
from housing.models import House
class UserProfile(models.Model):
user = models.OneToOneField(User, related_name="profile")
department = models.ForeignKey(Department, null=True, blank=True, relate... | 35.588235 | 90 | 0.745455 |
8b40b3b3cefebdbae9f6ed0d96c7e32cb8b862a8 | 5,667 | py | Python | samples/sample_kinesis_wordputter.py | rconroy293/amazon-kinesis-client-python | 66659655e31cec25ca0cc76c397478bdd5bcfcc8 | [
"Apache-2.0"
] | 338 | 2015-01-08T00:39:31.000Z | 2022-03-28T07:17:27.000Z | samples/sample_kinesis_wordputter.py | rconroy293/amazon-kinesis-client-python | 66659655e31cec25ca0cc76c397478bdd5bcfcc8 | [
"Apache-2.0"
] | 110 | 2015-01-06T01:22:16.000Z | 2022-03-28T07:26:07.000Z | samples/sample_kinesis_wordputter.py | rconroy293/amazon-kinesis-client-python | 66659655e31cec25ca0cc76c397478bdd5bcfcc8 | [
"Apache-2.0"
] | 221 | 2015-01-05T10:56:45.000Z | 2022-02-23T15:40:21.000Z | #!env python
'''
Copyright 2014-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
'''
from __future__ import print_function
import sys, random, time, argparse
from boto import kinesis
def get_stream_status(conn, stream_name):
'''
Query this provided connection ob... | 40.478571 | 130 | 0.662079 |
fe81645ece5b67fbe9c2c30f88db9128d4da2172 | 1,614 | py | Python | buffer.py | Casperinous/Lena | 202ed791ecf8e632b00fea8373d81df9b1f54d2c | [
"MIT"
] | 2 | 2021-06-04T07:32:35.000Z | 2021-06-07T01:41:37.000Z | buffer.py | Casperinous/Lena | 202ed791ecf8e632b00fea8373d81df9b1f54d2c | [
"MIT"
] | null | null | null | buffer.py | Casperinous/Lena | 202ed791ecf8e632b00fea8373d81df9b1f54d2c | [
"MIT"
] | null | null | null | '''
Code originally used by Androguard in https://github.com/androguard/androguard/blob/master/androguard/core/bytecode.py#L714
representing a different entity. Due to our simplier logic, we combine these 3 classes into one
'''
class Buffer:
def __init__(self, buff):
"""
Badly, the stable version ... | 25.619048 | 123 | 0.581784 |
50770a815b4fd42fc50087cdb288930a12ecc702 | 1,274 | py | Python | data/migrations/versions/eafdeadcebc7_remove_blob_index_from_manifestblob_.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | data/migrations/versions/eafdeadcebc7_remove_blob_index_from_manifestblob_.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | data/migrations/versions/eafdeadcebc7_remove_blob_index_from_manifestblob_.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | """Remove blob_index from ManifestBlob table
Revision ID: eafdeadcebc7
Revises: 9093adccc784
Create Date: 2018-08-07 15:57:54.001225
"""
# revision identifiers, used by Alembic.
revision = "eafdeadcebc7"
down_revision = "9093adccc784"
from alembic import op as original_op
from data.migrations.progress import Progre... | 29.627907 | 93 | 0.708006 |
ace97fc8f70b4eb93ae272c5575e89074715483c | 2,586 | py | Python | nipype/interfaces/camino/tests/test_auto_TrackDT.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/camino/tests/test_auto_TrackDT.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | 2 | 2018-04-17T19:18:16.000Z | 2020-03-04T22:05:02.000Z | nipype/interfaces/camino/tests/test_auto_TrackDT.py | oesteban/nipype | c14f24eba1da08711bbb894e049ee858ed740096 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..dti import TrackDT
def test_TrackDT_inputs():
input_map = dict(
anisfile=dict(
argstr='-anisfile %s',
extensions=None,
),
anisthresh=dict(argstr='-anisthresh %f', ),... | 28.733333 | 67 | 0.509667 |
bddef33302092b39deffbbf8e304e62f2f161184 | 5,695 | py | Python | invenio_requests/customizations/base/request_types.py | Pineirin/invenio-requests | 7eb85365128e4189e4c81d154e8918b09aae033d | [
"MIT"
] | null | null | null | invenio_requests/customizations/base/request_types.py | Pineirin/invenio-requests | 7eb85365128e4189e4c81d154e8918b09aae033d | [
"MIT"
] | null | null | null | invenio_requests/customizations/base/request_types.py | Pineirin/invenio-requests | 7eb85365128e4189e4c81d154e8918b09aae033d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 TU Wien.
# Copyright (C) 2021 CERN.
#
# Invenio-Requests is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Base class for creating custom types of requests.
The `RequestType` classes are... | 34.515152 | 87 | 0.668832 |
05ef8120697688582671622a511c15e2bccef1cd | 6,570 | py | Python | src/garage/torch/policies/categorical_cnn_policy.py | blacksph3re/garage | b4abe07f0fa9bac2cb70e4a3e315c2e7e5b08507 | [
"MIT"
] | 1,500 | 2018-06-11T20:36:24.000Z | 2022-03-31T08:29:01.000Z | src/garage/torch/policies/categorical_cnn_policy.py | blacksph3re/garage | b4abe07f0fa9bac2cb70e4a3e315c2e7e5b08507 | [
"MIT"
] | 2,111 | 2018-06-11T04:10:29.000Z | 2022-03-26T14:41:32.000Z | src/garage/torch/policies/categorical_cnn_policy.py | blacksph3re/garage | b4abe07f0fa9bac2cb70e4a3e315c2e7e5b08507 | [
"MIT"
] | 309 | 2018-07-24T11:18:48.000Z | 2022-03-30T16:19:48.000Z | """CategoricalCNNPolicy."""
import akro
import torch
from torch import nn
from garage import InOutSpec
from garage.torch.modules import CNNModule, MultiHeadedMLPModule
from garage.torch.policies.stochastic_policy import StochasticPolicy
class CategoricalCNNPolicy(StochasticPolicy):
"""CategoricalCNNPolicy.
... | 46.595745 | 79 | 0.598021 |
50f2cff4c54720f8d305a83ec151cc2473cd0de0 | 2,825 | py | Python | demo.py | iallabs/inception-web | ace76bbffe4dba242eb7b61fe9ce36ad0fb5fee7 | [
"Apache-2.0"
] | null | null | null | demo.py | iallabs/inception-web | ace76bbffe4dba242eb7b61fe9ce36ad0fb5fee7 | [
"Apache-2.0"
] | null | null | null | demo.py | iallabs/inception-web | ace76bbffe4dba242eb7b61fe9ce36ad0fb5fee7 | [
"Apache-2.0"
] | null | null | null | import os
from flask import (
Flask,
redirect,
url_for,
render_template,
request,
session,
make_response,
jsonify,
)
from inception import (
create_graph,
download_and_extract,
run_inference_on_image,
)
from shutil import copyfile
from werkzeug.utils import secure_f... | 24.780702 | 80 | 0.593628 |
16eddc1eab8628eec7e38d27b1f18df13dd480d7 | 4,283 | py | Python | contrib/ACE2P/infer.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | contrib/ACE2P/infer.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | contrib/ACE2P/infer.py | LielinJiang/PaddleSeg | 7c4d39da3d0ff635cac066aeb61e23dfada5d0d7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import cv2
import numpy as np
from utils.util import get_arguments
from utils.palette import get_palette
from PIL import Image as PILImage
import importlib
args = get_arguments()
config = importlib.import_module('config')
cfg = getattr(config, 'cfg')
# paddle垃圾回收策略FLAG,ACE2P模型较大,当显存不... | 32.694656 | 102 | 0.599113 |
64646d3bb53ccafdad1561309c2f0be1e0ecca6c | 3,996 | py | Python | sysID/fix_gearing.py | Team2470/FRC-2022-robot | bbc6d6277000be1929f4b746c73d06ca8afe926f | [
"BSD-3-Clause",
"MIT"
] | 1 | 2022-01-24T02:16:28.000Z | 2022-01-24T02:16:28.000Z | sysID/fix_gearing.py | Team2470/2022-robot | bbc6d6277000be1929f4b746c73d06ca8afe926f | [
"BSD-3-Clause",
"MIT"
] | 6 | 2022-01-24T05:06:39.000Z | 2022-02-19T23:44:29.000Z | sysID/fix_gearing.py | Team2470/FRC-2022-robot | bbc6d6277000be1929f4b746c73d06ca8afe926f | [
"BSD-3-Clause",
"MIT"
] | null | null | null | #! /usr/bin/env python3
import json
import sys
from pathlib import Path
if len(sys.argv) == 1:
print("Usage: {} sysid_data.json".format(sys.argv[0]))
sys.exit(1)
# Load in SysID data
print(f"sysid data file correct: {sys.argv[1]}")
sysid_data = None
with open(sys.argv[1]) as f:
sysid_data = json.load(f)
... | 37.698113 | 119 | 0.698699 |
c0fd5e8f1435d8f36ee39f0b50e54a2a5717b107 | 471 | py | Python | api-rest/apps/core/migrations/0003_auto_20200921_1323.py | zomars/koopers | 57208f936926bd9e8b08947495d62c25f1168939 | [
"MIT"
] | null | null | null | api-rest/apps/core/migrations/0003_auto_20200921_1323.py | zomars/koopers | 57208f936926bd9e8b08947495d62c25f1168939 | [
"MIT"
] | 8 | 2021-04-08T20:06:41.000Z | 2022-03-12T00:49:28.000Z | api-rest/apps/core/migrations/0003_auto_20200921_1323.py | zomars/koopers | 57208f936926bd9e8b08947495d62c25f1168939 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-09-21 18:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20200921_1135'),
]
operations = [
migrations.AlterField(
model_name='screenshot',
name='screen_siz... | 24.789474 | 129 | 0.600849 |
7d7e0daea4887832a0e84bfe81ad6858af5710ba | 236 | py | Python | src/backend/web/handlers/eventwizard.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | src/backend/web/handlers/eventwizard.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | src/backend/web/handlers/eventwizard.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | from datetime import timedelta
from flask import render_template
from backend.common.decorators import cached_public
@cached_public(ttl=timedelta(seconds=61))
def eventwizard() -> str:
return render_template("eventwizard.html")
| 21.454545 | 51 | 0.805085 |
ceb9cb1e1e812869675cc399d00fec56b869fc8e | 241 | py | Python | cablegate/urls.py | h3/django-cablegate | bffa2970a1fb21717a48cfce76b8a24f909acab0 | [
"BSD-3-Clause"
] | 1 | 2016-04-03T03:15:48.000Z | 2016-04-03T03:15:48.000Z | cablegate/urls.py | h3/django-cablegate | bffa2970a1fb21717a48cfce76b8a24f909acab0 | [
"BSD-3-Clause"
] | null | null | null | cablegate/urls.py | h3/django-cablegate | bffa2970a1fb21717a48cfce76b8a24f909acab0 | [
"BSD-3-Clause"
] | 1 | 2019-07-31T06:02:12.000Z | 2019-07-31T06:02:12.000Z | from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^', include('cablegate.cable.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| 24.1 | 60 | 0.713693 |
447d7d6ece6feb5623c6e671da630aa4560e19aa | 7,355 | py | Python | server.py | miuho/Blockchain-Query-API | ba027081b16e9a9fdfc8493feae3f9ab28a970f9 | [
"MIT"
] | null | null | null | server.py | miuho/Blockchain-Query-API | ba027081b16e9a9fdfc8493feae3f9ab28a970f9 | [
"MIT"
] | null | null | null | server.py | miuho/Blockchain-Query-API | ba027081b16e9a9fdfc8493feae3f9ab28a970f9 | [
"MIT"
] | null | null | null | # server.py
# Run http server for Bitcoin blockchain Query API
#
# HingOn Miu
# https://docs.python.org/3/library/http.server.html
import io
import random
import string
import json
import time
import socket
import threading
from SocketServer import ThreadingMixIn
from BaseHTTPServer import HTTPServer, BaseHTTPRequest... | 30.26749 | 100 | 0.729436 |
c342ee22145631cc6b7285c012b4d51c5c032051 | 19,647 | py | Python | up42/viztools.py | andher1802/dummy_0532 | fb953c2785652c583d1147a2b688997e260e6afa | [
"MIT"
] | 72 | 2020-04-06T16:36:36.000Z | 2022-03-30T23:39:14.000Z | up42/viztools.py | j-tr/up42-py | 163b5a324775998987fc646afe8d5c257dd559ee | [
"MIT"
] | 59 | 2020-04-08T14:50:40.000Z | 2022-03-23T22:14:46.000Z | up42/viztools.py | j-tr/up42-py | 163b5a324775998987fc646afe8d5c257dd559ee | [
"MIT"
] | 40 | 2020-04-07T22:34:05.000Z | 2022-03-23T10:57:15.000Z | """
Visualization tools available in various objects
"""
# pylint: disable=dangerous-default-value
from typing import Tuple, List, Union, Optional
import math
from pathlib import Path
import warnings
import numpy as np
from shapely.geometry import box
import geopandas as gpd
from geopandas import GeoDataFrame
import... | 35.209677 | 122 | 0.548226 |
d79692f2207a4efd11ce732e5f576391cb3195fa | 4,416 | py | Python | nova/api/openstack/compute/image_metadata.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | 1 | 2015-07-15T08:51:16.000Z | 2015-07-15T08:51:16.000Z | nova/api/openstack/compute/image_metadata.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/image_metadata.py | bopopescu/trusted-nova | b440afb89f6f170c0831f5d6318a08ec41bc8c0a | [
"Apache-2.0"
] | 2 | 2019-06-12T00:52:15.000Z | 2020-07-24T10:35:29.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | 37.109244 | 78 | 0.668025 |
e3635627346d8e7dde0a425f155ab70ec59e7d90 | 12,414 | py | Python | sdk/python/pulumi_azure_native/web/v20150801/list_site_backup_status_secrets.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20150801/list_site_backup_status_secrets.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20150801/list_site_backup_status_secrets.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.79375 | 331 | 0.637506 |
4ace6a685e6d4b0452b5ef260810b53a2b01e6a1 | 399 | py | Python | python/django/experiments/experiments/wsgi.py | romanthekat/experiments | b37125e54e846cfa6027319d724f4028e81b0ad6 | [
"MIT"
] | null | null | null | python/django/experiments/experiments/wsgi.py | romanthekat/experiments | b37125e54e846cfa6027319d724f4028e81b0ad6 | [
"MIT"
] | null | null | null | python/django/experiments/experiments/wsgi.py | romanthekat/experiments | b37125e54e846cfa6027319d724f4028e81b0ad6 | [
"MIT"
] | null | null | null | """
WSGI config for experiments project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
fab3409b42334a3025712e9728e5a5095f090cb9 | 9,673 | py | Python | scripts/reduce_sql.py | hannes/duckdb | 4a24d71edecc7c0018eb3860d2e104cfe90462b6 | [
"MIT"
] | null | null | null | scripts/reduce_sql.py | hannes/duckdb | 4a24d71edecc7c0018eb3860d2e104cfe90462b6 | [
"MIT"
] | null | null | null | scripts/reduce_sql.py | hannes/duckdb | 4a24d71edecc7c0018eb3860d2e104cfe90462b6 | [
"MIT"
] | null | null | null | import re
import subprocess
import time
import os
import fuzzer_helper
import multiprocessing
import sqlite3
multiprocessing.set_start_method('fork')
get_reduced_query = '''
SELECT * FROM reduce_sql_statement('${QUERY}');
'''
def sanitize_error(err):
err = re.sub('Error: near line \d+: ', '', err)
err = err.r... | 37.203846 | 155 | 0.608808 |
a2edcee42da1b4e0eda75acfa762ce38acac522e | 608 | py | Python | vault_cli/metadata.py | irvansemestanya/vault-cli | 220989a336e999ba770761fcdc4e6d829d644230 | [
"Apache-2.0"
] | 52 | 2018-04-11T12:51:42.000Z | 2022-03-29T12:51:54.000Z | vault_cli/metadata.py | irvansemestanya/vault-cli | 220989a336e999ba770761fcdc4e6d829d644230 | [
"Apache-2.0"
] | 186 | 2018-04-19T13:12:43.000Z | 2022-01-27T08:39:45.000Z | vault_cli/metadata.py | irvansemestanya/vault-cli | 220989a336e999ba770761fcdc4e6d829d644230 | [
"Apache-2.0"
] | 15 | 2018-04-19T09:40:48.000Z | 2021-08-24T14:42:36.000Z | import io
from distutils import dist
from typing import Mapping, Optional
import pkg_resources
def extract_metadata() -> Mapping[str, Optional[str]]:
distribution = pkg_resources.get_distribution("vault-cli")
metadata_str = distribution.get_metadata(distribution.PKG_INFO)
metadata_obj = dist.Distributio... | 27.636364 | 67 | 0.720395 |
4ae42e4f3b92e40f20f44c3232ebf4a1e8e6989b | 149,145 | py | Python | solver.py | LigninTools/lignet2.0 | 62ebc786b2a4c85cf60f59b1e3347d170fa5081a | [
"BSD-2-Clause"
] | null | null | null | solver.py | LigninTools/lignet2.0 | 62ebc786b2a4c85cf60f59b1e3347d170fa5081a | [
"BSD-2-Clause"
] | null | null | null | solver.py | LigninTools/lignet2.0 | 62ebc786b2a4c85cf60f59b1e3347d170fa5081a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-C", "--PLIGC", type=float,
help="mol number of C in input", required=True)
parser.add_argument("-H", "--PLIGH", type=float,
help="mol number of H in input", required=True)
parser.add... | 106.456103 | 6,993 | 0.555366 |
ca04b72a3d017ae8c18ff0a576282d95ee324e79 | 1,946 | py | Python | digproj/persona/views.py | mans-18/digest | 2c62ab33b8647b6e3da93a714da614ff201eee67 | [
"MIT"
] | null | null | null | digproj/persona/views.py | mans-18/digest | 2c62ab33b8647b6e3da93a714da614ff201eee67 | [
"MIT"
] | null | null | null | digproj/persona/views.py | mans-18/digest | 2c62ab33b8647b6e3da93a714da614ff201eee67 | [
"MIT"
] | null | null | null | from rest_framework import viewsets, mixins
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Kollege, Event, Persona
from persona import serializers
class BasePersonaAttrViewSet(viewsets.GenericViewSet,
... | 35.381818 | 77 | 0.723535 |
d3cc9d444271665a2b443ba7670d10a3209623a5 | 1,929 | py | Python | src/mpd_reader.py | dlesz/recsyschallenge2018 | 4f06333412c1146d1f3d0784e55c776cfd657a98 | [
"Apache-2.0"
] | null | null | null | src/mpd_reader.py | dlesz/recsyschallenge2018 | 4f06333412c1146d1f3d0784e55c776cfd657a98 | [
"Apache-2.0"
] | null | null | null | src/mpd_reader.py | dlesz/recsyschallenge2018 | 4f06333412c1146d1f3d0784e55c776cfd657a98 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import argparse
import codecs
import logging
import time
import numpy
import pandas as pd
from pandas.io.json import json_normalize
import os
import json
def read_data(folderpath):
start = time.time()
logging.debug("reading data from %s", folderpath)
# creating empt... | 32.694915 | 117 | 0.648004 |
006fe43e33f4db4cfe4f891db82071b43879bfe4 | 2,142 | py | Python | toyota_na/vehicle/entity_types/ToyotaRemoteStart.py | MrReBot/toyota-na | 4afd28660c1f964ce52d3c3bc5b985221b89534e | [
"MIT"
] | 8 | 2021-09-21T16:53:58.000Z | 2022-01-19T02:01:24.000Z | toyota_na/vehicle/entity_types/ToyotaRemoteStart.py | MrReBot/toyota-na | 4afd28660c1f964ce52d3c3bc5b985221b89534e | [
"MIT"
] | 7 | 2022-01-30T03:08:57.000Z | 2022-03-21T19:04:48.000Z | toyota_na/vehicle/entity_types/ToyotaRemoteStart.py | MrReBot/toyota-na | 4afd28660c1f964ce52d3c3bc5b985221b89534e | [
"MIT"
] | 3 | 2022-01-19T08:03:56.000Z | 2022-01-22T03:47:29.000Z | from datetime import datetime, timedelta
from typing import Optional
import pytz
class ToyotaRemoteStart:
_on: bool
_start_time: Optional[datetime]
_timer: Optional[float]
def __init__(self, date: Optional[str], on: bool, timer: Optional[float]):
if date is not None:
self._start_... | 31.5 | 142 | 0.609711 |
aeb7d83c5bd7c98070696fd4899386de6bcd1e1e | 7,099 | py | Python | dymos/transcriptions/common/timeseries_output_comp.py | Kenneth-T-Moore/dymos | 0ae11aab9cb69ac9dd1d784616d1dfe35a6e5b11 | [
"Apache-2.0"
] | null | null | null | dymos/transcriptions/common/timeseries_output_comp.py | Kenneth-T-Moore/dymos | 0ae11aab9cb69ac9dd1d784616d1dfe35a6e5b11 | [
"Apache-2.0"
] | null | null | null | dymos/transcriptions/common/timeseries_output_comp.py | Kenneth-T-Moore/dymos | 0ae11aab9cb69ac9dd1d784616d1dfe35a6e5b11 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import openmdao.api as om
from scipy.linalg import block_diag
from dymos.transcriptions.grid_data import GridData
from dymos.utils.lagrange import lagrange_matrices
class TimeseriesOutputCompBase(om.ExplicitComponent):
"""
TimeseriesOutputComp collects variable values from the phase and pr... | 44.647799 | 99 | 0.599239 |
c42f51519e649b5edeffc6cc4ceac5299b064c4c | 2,238 | py | Python | Python/Sonstige_Uebungen/create_and_parse_ip_adresses.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/create_and_parse_ip_adresses.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/create_and_parse_ip_adresses.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: create_and_parse_ip_adresses.py
# Project: Sonstige_Uebungen
#-----
# Created Date: Saturday 16.01.2021, 16:54
# Author: Apop85
#-----
# Last Modified: Saturday 16.01.2021, 19:10
#-----
# Copyright (c) 2021 Apop85
# This software is published under the MIT ... | 29.447368 | 112 | 0.592046 |
5ccb6aa7133da67aa99b774d5129cd85b05853af | 2,319 | py | Python | tests/test_util.py | AFCYBER-DREAM/piedpiper-gman | fb4c36b0bdf17161c52e5b37c3216139fe40a99a | [
"MIT"
] | null | null | null | tests/test_util.py | AFCYBER-DREAM/piedpiper-gman | fb4c36b0bdf17161c52e5b37c3216139fe40a99a | [
"MIT"
] | 3 | 2019-05-23T02:04:47.000Z | 2019-06-10T20:30:21.000Z | tests/test_util.py | AFCYBER-DREAM/piperci-gman | fb4c36b0bdf17161c52e5b37c3216139fe40a99a | [
"MIT"
] | 3 | 2019-06-04T19:29:49.000Z | 2019-06-24T14:21:14.000Z | import uuid
import json
import pytest
from piperci import sri
from piperci_gman.util import (GManJSONEncoder, Api)
from piperci_gman.gman import GMan
from piperci_gman.artman import ArtMan
from pytest import raises
def test_jsonencoder_uuid():
json.dumps({'uuid': uuid.uuid4()}, cls=GManJSONEncoder)
def test_j... | 24.15625 | 88 | 0.721432 |
bd1cd41bfcc4a0f457fefb0da410f63d438a15bb | 13,851 | py | Python | PySide2/QtQml.py | arjun-namdeo/py_stubs | 605bb167e239978f5417f3f1fc1f5c12e2a243cc | [
"MIT"
] | null | null | null | PySide2/QtQml.py | arjun-namdeo/py_stubs | 605bb167e239978f5417f3f1fc1f5c12e2a243cc | [
"MIT"
] | null | null | null | PySide2/QtQml.py | arjun-namdeo/py_stubs | 605bb167e239978f5417f3f1fc1f5c12e2a243cc | [
"MIT"
] | null | null | null | from PySide2.QtCore import QObject as _QObject
class _Property(object):
def __call__(*args, **kwargs):
"""
x.__call__(...) <==> x(...)
"""
pass
def __init__(*args, **kwargs):
"""
x.__init__(...) initializes x; see help(type(x)) for signature
... | 15.121179 | 70 | 0.456646 |
b65c93fa80afd8062496ebb369c4c5ad1020162f | 405 | py | Python | pygram/filters/sepia.py | achillesrasquinha/PyGram | 2ca49c8ac3287cb0b722e1086f0c55418e197a28 | [
"MIT"
] | 18 | 2017-02-02T05:33:20.000Z | 2022-02-11T05:31:44.000Z | pygram/filters/sepia.py | Rutvikbk/PyGram | 2ca49c8ac3287cb0b722e1086f0c55418e197a28 | [
"MIT"
] | null | null | null | pygram/filters/sepia.py | Rutvikbk/PyGram | 2ca49c8ac3287cb0b722e1086f0c55418e197a28 | [
"MIT"
] | 11 | 2017-02-03T09:39:27.000Z | 2018-03-26T18:59:37.000Z | import numpy as np
from PIL import Image
def sepia(image):
arr = np.copy(image)
r,g,b = arr[:,:,0], arr[:,:,1], arr[:,:,2]
arr[:,:,0] = np.minimum(r * 0.393 + g * 0.769 + b * 0.189, 255)
arr[:,:,1] = np.minimum(r * 0.349 + g * 0.686 + b * 0.168, 255)
arr[:,:,2] = np.minimum(r * 0.272 +... | 27 | 67 | 0.491358 |
894a701c0cd644b5e3e237e8bca282f76a92312b | 153 | py | Python | pyjac/__main__.py | stgeke/pyJac-v2 | c2716a05df432efd8e5f6cc5cc3d46b72c24c019 | [
"MIT"
] | 9 | 2018-10-08T07:49:20.000Z | 2021-06-26T15:28:30.000Z | pyjac/__main__.py | stgeke/pyJac-v2 | c2716a05df432efd8e5f6cc5cc3d46b72c24c019 | [
"MIT"
] | 13 | 2018-09-01T14:17:51.000Z | 2021-07-30T16:19:33.000Z | pyjac/__main__.py | arghdos/spyJac | bdd6940c27681e3b19ee41efb31abd20a89d1be8 | [
"MIT"
] | 7 | 2018-09-08T11:57:34.000Z | 2022-02-14T13:57:20.000Z | import sys
from pyjac import utils
def main(args=None):
if args is None:
utils.create()
if __name__ == '__main__':
sys.exit(main())
| 11.769231 | 26 | 0.627451 |
9dbf3c44398528f585cb44329e01eb1173640b72 | 8,881 | py | Python | office/outlook.py | ktr/office | 27b502aae6875aca57a41adc8b3f63236c3cb2e0 | [
"MIT"
] | null | null | null | office/outlook.py | ktr/office | 27b502aae6875aca57a41adc8b3f63236c3cb2e0 | [
"MIT"
] | null | null | null | office/outlook.py | ktr/office | 27b502aae6875aca57a41adc8b3f63236c3cb2e0 | [
"MIT"
] | null | null | null | """
outlook.py - utilities to help with Microsoft Outlook (TM)
Example:
outlook = Outlook()
tbl = outlook.list_to_tbl([[1, 2, 3], [4, 5, 6]])
with open(r'H:\test1.png', 'rb') as io:
img = outlook.inline_img(io)
outlook.create_mail('test@example.com', 'Hello!', f'Hello!<br><br>{tbl}<br><br>{img... | 36.397541 | 130 | 0.581691 |
08008ca212f21a36d762e9da25b5d6dff0bff6ee | 1,631 | py | Python | resources/rides.py | mikenthiwa/Ride-My-Way | 2ad702903f971e0cd474d9e7339174bbe37c47d8 | [
"MIT"
] | null | null | null | resources/rides.py | mikenthiwa/Ride-My-Way | 2ad702903f971e0cd474d9e7339174bbe37c47d8 | [
"MIT"
] | 2 | 2018-06-12T15:29:44.000Z | 2018-07-04T09:59:12.000Z | resources/rides.py | mikenthiwa/Ride-My-Way | 2ad702903f971e0cd474d9e7339174bbe37c47d8 | [
"MIT"
] | 4 | 2018-06-24T19:05:33.000Z | 2018-10-17T15:05:43.000Z | from flask_restplus import Resource, Namespace, reqparse, fields
from app.models import Rides
from resources.auth import token_required
rides = Rides()
api = Namespace("Rides", description="Passenger related operations")
request_model = api.model('Request Model', {'username': fields.String,
... | 28.12069 | 120 | 0.642551 |
52a74e260824f9aea1b54ce683427d3a0b3ec4ed | 7,709 | py | Python | app/users/views.py | jingshu-fk/FXTest_copy | 150012f87021b6b8204fd342c62538c10d8dfa85 | [
"MIT"
] | null | null | null | app/users/views.py | jingshu-fk/FXTest_copy | 150012f87021b6b8204fd342c62538c10d8dfa85 | [
"MIT"
] | 2 | 2021-03-26T00:24:28.000Z | 2022-03-22T22:06:39.000Z | app/users/views.py | jingshu-fk/FXTest_copy | 150012f87021b6b8204fd342c62538c10d8dfa85 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author : lileilei
# @File : views.py
# @Time : 2017/12/7 12:25
from flask import Blueprint
user = Blueprint('user', __name__)
from flask import redirect, request, \
session, url_for, flash, jsonify
from app.models import *
from flask.views import View, MethodView
from common.decor... | 37.604878 | 93 | 0.569983 |
f25d7fca5b5fdbeba8c9fb4be7f65eea5ff9cab5 | 154 | py | Python | scrapers/AGY-isle-of-anglesey/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 4 | 2018-10-17T13:30:08.000Z | 2021-06-22T13:29:43.000Z | scrapers/AGY-isle-of-anglesey/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 46 | 2018-10-15T13:47:48.000Z | 2022-03-23T10:26:18.000Z | scrapers/AGY-isle-of-anglesey/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 1 | 2018-10-15T13:36:03.000Z | 2018-10-15T13:36:03.000Z | from lgsf.councillors.scrapers import ModGovCouncillorScraper
class Scraper(ModGovCouncillorScraper):
base_url = "http://democracy.anglesey.gov.uk"
| 25.666667 | 61 | 0.811688 |
dd87e6475eab3d287734190ac09a3edb4c191ccd | 47,888 | py | Python | evaluate_3dpw_mine.py | akashsengupta1997/ProHMR | 7015a3d070c79b4571d43abdf5e522468091a94d | [
"BSD-3-Clause"
] | null | null | null | evaluate_3dpw_mine.py | akashsengupta1997/ProHMR | 7015a3d070c79b4571d43abdf5e522468091a94d | [
"BSD-3-Clause"
] | null | null | null | evaluate_3dpw_mine.py | akashsengupta1997/ProHMR | 7015a3d070c79b4571d43abdf5e522468091a94d | [
"BSD-3-Clause"
] | null | null | null | import os
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
import argparse
import math
import my_config
from prohmr.datasets.pw3d_eval_dataset import PW3DEvalDataset
from prohmr.configs import get_conf... | 53.927928 | 178 | 0.589187 |
1ab6542953d11f1d2d8d5391f55e0e28f9721d42 | 13,117 | py | Python | adjutant/common/quota.py | CCI-MOC/adjutant | 032db3124ea0b0632afdfc27afc60b6c66cf5f66 | [
"Apache-2.0"
] | null | null | null | adjutant/common/quota.py | CCI-MOC/adjutant | 032db3124ea0b0632afdfc27afc60b6c66cf5f66 | [
"Apache-2.0"
] | null | null | null | adjutant/common/quota.py | CCI-MOC/adjutant | 032db3124ea0b0632afdfc27afc60b6c66cf5f66 | [
"Apache-2.0"
] | 1 | 2019-04-18T12:21:59.000Z | 2019-04-18T12:21:59.000Z | # Copyright (C) 2015 Catalyst IT Ltd
#
# 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 o... | 39.272455 | 78 | 0.593733 |
b1c9bd63ff9d9946a0583df2997c2d43c8e6f9a6 | 3,563 | py | Python | drag5a.py | jwcraftsman/kivytest | e1271239560d6f81d18dc15ca8ba0ce08163b800 | [
"MIT"
] | null | null | null | drag5a.py | jwcraftsman/kivytest | e1271239560d6f81d18dc15ca8ba0ce08163b800 | [
"MIT"
] | null | null | null | drag5a.py | jwcraftsman/kivytest | e1271239560d6f81d18dc15ca8ba0ce08163b800 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Use touch events to drag a rectangle around the screen with borders,
keeping the rectangle inside a specified widget and keeping the
rectangle from sliding away from the touch position when going in and
out of the specified widget's screen area. The rectangle is also only
allowed to be drop... | 25.45 | 70 | 0.580971 |
03c85b8b62da14c0d751ec7e388acf0ea092f514 | 6,146 | py | Python | xmind2testlink/sharedparser.py | WinterDing/xmind2testlink | ae84ae173afd24dcd0519cd501506f2650fd337b | [
"MIT"
] | null | null | null | xmind2testlink/sharedparser.py | WinterDing/xmind2testlink | ae84ae173afd24dcd0519cd501506f2650fd337b | [
"MIT"
] | null | null | null | xmind2testlink/sharedparser.py | WinterDing/xmind2testlink | ae84ae173afd24dcd0519cd501506f2650fd337b | [
"MIT"
] | 1 | 2020-12-14T06:00:25.000Z | 2020-12-14T06:00:25.000Z | from xmindparser import xmind_to_dict, config
from .datatype import *
config['hideEmptyValue'] = False
_config = {'sep': ' ',
'valid_sep': '/>-+',
'precondition_sep': '\n----\n',
'summary_sep': '\n----\n'}
def ignore_filter(topics):
"""filter topics starts with !"""
result =... | 27.809955 | 99 | 0.622356 |
bd558656981b3f712358d03ca088cf37aacf0aae | 565 | py | Python | LeetCode/0452_Minimum_Number_of_Arrows_to_Burst_Balloons.py | Achyut-sudo/PythonAlgorithms | 21fb6522510fde7a0877b19a8cedd4665938a4df | [
"MIT"
] | 144 | 2020-09-13T22:54:57.000Z | 2022-02-24T21:54:25.000Z | LeetCode/0452_Minimum_Number_of_Arrows_to_Burst_Balloons.py | Achyut-sudo/PythonAlgorithms | 21fb6522510fde7a0877b19a8cedd4665938a4df | [
"MIT"
] | 587 | 2020-05-06T18:55:07.000Z | 2021-09-20T13:14:53.000Z | LeetCode/0452_Minimum_Number_of_Arrows_to_Burst_Balloons.py | Achyut-sudo/PythonAlgorithms | 21fb6522510fde7a0877b19a8cedd4665938a4df | [
"MIT"
] | 523 | 2020-09-09T12:07:13.000Z | 2022-02-24T21:54:31.000Z | class Solution:
def findMinArrowShots(self, points: List[List[int]]) -> int:
if points == []:
return 0
points.sort(key = lambda x: x[0])
start = points[0][0]
end = points[0][1]
ans = len(points)
for i in range(1, len(points)):
if start <= point... | 29.736842 | 64 | 0.414159 |
86306a66bd617f64631f7112508129b41aaa7b54 | 570 | py | Python | backend/home/api/v1/urls.py | crowdbotics-apps/virtual-match-29867 | 9c2a092e49db5aa5c09704c957d616390a4e5543 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/api/v1/urls.py | crowdbotics-apps/virtual-match-29867 | 9c2a092e49db5aa5c09704c957d616390a4e5543 | [
"FTL",
"AML",
"RSA-MD"
] | 15 | 2021-08-23T01:13:44.000Z | 2022-03-13T17:38:13.000Z | backend/home/api/v1/urls.py | crowdbotics-apps/virtual-match-29867 | 9c2a092e49db5aa5c09704c957d616390a4e5543 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .viewsets import MessageViewSet, CustomTextViewSet, HomePageViewSet
from home.api.v1.viewsets import (
SignupViewSet,
LoginViewSet,
)
router = DefaultRouter()
router.register("signup", SignupViewSet, basename="signup")... | 28.5 | 72 | 0.782456 |
aec598d37e499a71afb9ff4482b2213048230ba9 | 997 | py | Python | sites/mysites/tools/checkers.py | cmwaura/Final_Red_Scrap | 6b1b78de7d1129cda787e9f4688ddd409af39eb5 | [
"MIT"
] | null | null | null | sites/mysites/tools/checkers.py | cmwaura/Final_Red_Scrap | 6b1b78de7d1129cda787e9f4688ddd409af39eb5 | [
"MIT"
] | null | null | null | sites/mysites/tools/checkers.py | cmwaura/Final_Red_Scrap | 6b1b78de7d1129cda787e9f4688ddd409af39eb5 | [
"MIT"
] | null | null | null | from dynamic_scraper.spiders.django_checker import DjangoChecker
from mysites.models import JobAd
class JobChecker(DjangoChecker):
'''
The JobChecker class inherits from the DjangoChecker class in the Dynamic Django scraper
module hence why we imported it. The main aim of this module is checking the objects that ... | 47.47619 | 103 | 0.790371 |
dc41e0e960525b53a902f0f2949214041e8e4935 | 778 | py | Python | Tests/test_Calculator.py | axisonoid/calculator | 5eb63b6f0fb544feeb50ad596520eb6dbad62be8 | [
"MIT"
] | 1 | 2021-06-26T11:22:19.000Z | 2021-06-26T11:22:19.000Z | Tests/test_Calculator.py | axisonoid/calculator | 5eb63b6f0fb544feeb50ad596520eb6dbad62be8 | [
"MIT"
] | null | null | null | Tests/test_Calculator.py | axisonoid/calculator | 5eb63b6f0fb544feeb50ad596520eb6dbad62be8 | [
"MIT"
] | null | null | null | import unittest
from Calculator.Calculator import Calculator
from CsvReader.CsvReader import CsvReader
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
self.calculator = Calculator()
def test_instantiate_calculator(self):
self.assertIsInstance(self.calculator, Calculator)
de... | 31.12 | 95 | 0.695373 |
1f14bab1dc1508f74fb790ff4c8b9e1a5119dfe0 | 2,125 | py | Python | src/exif/_app1_create.py | TNThieding/exif | 2e59701aec7416fbb3b2db76e7d090f166f1f132 | [
"MIT"
] | 51 | 2018-12-28T19:48:40.000Z | 2021-12-10T00:35:41.000Z | src/exif/_app1_create.py | TNThieding/exif | 2e59701aec7416fbb3b2db76e7d090f166f1f132 | [
"MIT"
] | 33 | 2019-02-08T10:15:25.000Z | 2022-02-11T18:37:45.000Z | src/exif/_app1_create.py | TNThieding/exif | 2e59701aec7416fbb3b2db76e7d090f166f1f132 | [
"MIT"
] | 11 | 2019-10-24T14:03:02.000Z | 2020-12-10T04:07:20.000Z | """Utility to create empty APP1 metadata bytes."""
from plum.bigendian import uint16
from exif._constants import ATTRIBUTE_ID_MAP, ExifMarkers
from exif._datatypes import ExifType, Ifd, IfdTag, TiffByteOrder, TiffHeader
HEADER_BYTES_EXCLUDED_FROM_LENGTH = (
2 # IMPORTANT: APP1 marker is excluded from the length... | 30.797101 | 82 | 0.657412 |
a37e8ce9569e2f9a3498fc7b5610383ba38d5a2b | 17,615 | py | Python | gm/rebaseline_server/imagediffdb.py | Acidburn0zzz/tampllate-skia | 7d5d73cfaee397788788765238725a5058ee7f08 | [
"BSD-3-Clause"
] | 11 | 2015-01-19T22:09:14.000Z | 2019-10-03T21:45:31.000Z | gm/rebaseline_server/imagediffdb.py | Acidburn0zzz/tampllate-skia | 7d5d73cfaee397788788765238725a5058ee7f08 | [
"BSD-3-Clause"
] | null | null | null | gm/rebaseline_server/imagediffdb.py | Acidburn0zzz/tampllate-skia | 7d5d73cfaee397788788765238725a5058ee7f08 | [
"BSD-3-Clause"
] | 9 | 2015-02-23T12:59:43.000Z | 2022-01-27T10:30:45.000Z | #!/usr/bin/python
"""
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Calulate differences between image pairs, and store them in a database.
"""
import contextlib
import csv
import logging
import os
import re
import shutil
import sys
impo... | 38.971239 | 80 | 0.71723 |
cfecba810e36331947d77c035996417aa2a118ab | 8,617 | py | Python | inkind/contribution.py | rubin-observatory/in-kind | af837ff8bfb9f5f643b0f11f92defeed58846958 | [
"MIT"
] | null | null | null | inkind/contribution.py | rubin-observatory/in-kind | af837ff8bfb9f5f643b0f11f92defeed58846958 | [
"MIT"
] | null | null | null | inkind/contribution.py | rubin-observatory/in-kind | af837ff8bfb9f5f643b0f11f92defeed58846958 | [
"MIT"
] | null | null | null | import sys
# ======================================================================
class Contribution():
def __init__(self, vb=False, program=None):
self.vb = vb
self.PROGRAM_CODE = program
self.current = None
self.ID = None
self.URL = None
self.TITLE = None
... | 42.448276 | 228 | 0.543577 |
c6900a2b165728df482de4a9373ac81b3fcfc3a0 | 3,020 | py | Python | gtrxl.py | stefanosantaris/sar | c011089d81699c2950b005e4d7d7d86fc5a95667 | [
"MIT"
] | 3 | 2021-09-27T03:10:01.000Z | 2021-12-29T07:18:06.000Z | gtrxl.py | stefanosantaris/sar | c011089d81699c2950b005e4d7d7d86fc5a95667 | [
"MIT"
] | null | null | null | gtrxl.py | stefanosantaris/sar | c011089d81699c2950b005e4d7d7d86fc5a95667 | [
"MIT"
] | null | null | null | import os
import torch as T
import torch.optim as optim
import torch.nn.functional as F
import torch.nn as nn
from typing import Optional
from torch.nn import TransformerEncoder, TransformerEncoderLayer
from torch import Tensor
import math
'''
Positional Encoding : takes a 2d tensor --> 3d tensor
Injects some informat... | 38.227848 | 153 | 0.664238 |
137837915daf470736bdad1def33eb5f5a3e04c4 | 7,529 | py | Python | flumine/streams/historicalstream.py | betcode-org/flumine | b33d82b75175106b2de0d0c4f9851599b085e389 | [
"MIT"
] | 2 | 2022-03-21T11:42:56.000Z | 2022-03-26T08:36:18.000Z | flumine/streams/historicalstream.py | betcode-org/flumine | b33d82b75175106b2de0d0c4f9851599b085e389 | [
"MIT"
] | 4 | 2022-03-25T09:49:37.000Z | 2022-03-25T10:18:13.000Z | flumine/streams/historicalstream.py | betcode-org/flumine | b33d82b75175106b2de0d0c4f9851599b085e389 | [
"MIT"
] | null | null | null | import logging
import datetime
from typing import Optional
from betfairlightweight.streaming import StreamListener, HistoricalGeneratorStream
from betfairlightweight.streaming.stream import MarketStream, RaceStream
from betfairlightweight.streaming.cache import MarketBookCache, RaceCache
from betfairlightweight.resourc... | 37.834171 | 87 | 0.59822 |
768aaed0c43e30592ad75c47e47f304261cf7d97 | 38,011 | py | Python | torcharrow/test/lib_test/test_column.py | Nayef211/torcharrow | 28b8ca4bf1d91878daf087a0030790a8161b5f1f | [
"BSD-3-Clause"
] | null | null | null | torcharrow/test/lib_test/test_column.py | Nayef211/torcharrow | 28b8ca4bf1d91878daf087a0030790a8161b5f1f | [
"BSD-3-Clause"
] | null | null | null | torcharrow/test/lib_test/test_column.py | Nayef211/torcharrow | 28b8ca4bf1d91878daf087a0030790a8161b5f1f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import unittest
from dataclasses import dataclass
fr... | 38.985641 | 198 | 0.580122 |
53f978bd7c2f2f08ac846d0e0272334b6fb10bb0 | 4,019 | py | Python | com.ppc.Bot/devices/lock/lock.py | slrobertson1/botlab | fef6005c57010a30ed8d1d599d15644dd7c870d8 | [
"Apache-2.0"
] | null | null | null | com.ppc.Bot/devices/lock/lock.py | slrobertson1/botlab | fef6005c57010a30ed8d1d599d15644dd7c870d8 | [
"Apache-2.0"
] | null | null | null | com.ppc.Bot/devices/lock/lock.py | slrobertson1/botlab | fef6005c57010a30ed8d1d599d15644dd7c870d8 | [
"Apache-2.0"
] | null | null | null | '''
Created on February 8, 2018
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
from devices.device import Device
class LockDevice(Device):
"""Lock Device"""
# List of Device Types this class is compatib... | 30.915385 | 124 | 0.657129 |
92dab6b800ffa79a99ab39d22c9202555d66fba6 | 93 | py | Python | src/friendapp/apps.py | Darshee-m/Friend_Finder_WebApp | 98c30386df9780b7fc0225f1df777aa0be704f3f | [
"bzip2-1.0.6"
] | 15 | 2020-12-23T13:56:49.000Z | 2021-12-10T11:04:23.000Z | src/friendapp/apps.py | Darshee-m/Friend_Finder_WebApp | 98c30386df9780b7fc0225f1df777aa0be704f3f | [
"bzip2-1.0.6"
] | 41 | 2021-03-19T07:51:48.000Z | 2021-11-22T09:45:46.000Z | src/friendapp/apps.py | Darshee-m/Friend_Finder_WebApp | 98c30386df9780b7fc0225f1df777aa0be704f3f | [
"bzip2-1.0.6"
] | 3 | 2021-03-24T15:18:24.000Z | 2021-09-11T14:51:35.000Z | from django.apps import AppConfig
class FriendappConfig(AppConfig):
name = 'friendapp'
| 15.5 | 33 | 0.763441 |
73f1ee0d5cd868e51b13a348211443fb5e4f8cbd | 4,467 | py | Python | learn_stem/python/utilities/pyprogrammer.py | wgong/open_source_learning | ccf819626bf17125abcee8edf66401e4a0d2dc20 | [
"Apache-2.0"
] | 1 | 2019-04-11T13:27:29.000Z | 2019-04-11T13:27:29.000Z | learn_stem/python/utilities/pyprogrammer.py | wgong/open_source_learning | ccf819626bf17125abcee8edf66401e4a0d2dc20 | [
"Apache-2.0"
] | 4 | 2017-03-09T18:42:19.000Z | 2017-03-19T21:06:23.000Z | learn_stem/python/utilities/pyprogrammer.py | wgong/open_source_learning | ccf819626bf17125abcee8edf66401e4a0d2dc20 | [
"Apache-2.0"
] | null | null | null | # Evolution of a Python programmer.py
#Newbie programmer
def factorial_newbie(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial_newbie(6)
#First year programmer, studied Pascal
def factorial_pascal(x):
result = 1
i = 2
while i <= x:
... | 24.145946 | 140 | 0.565704 |
f8f212f258c8b009406970eb693d0b3788589c5a | 384 | py | Python | sign.py | abinash-boruah/Spam-SMS-classifier | 4c57872c3c924fefad34c4d82fe7fa4122f6aa4a | [
"Unlicense"
] | null | null | null | sign.py | abinash-boruah/Spam-SMS-classifier | 4c57872c3c924fefad34c4d82fe7fa4122f6aa4a | [
"Unlicense"
] | null | null | null | sign.py | abinash-boruah/Spam-SMS-classifier | 4c57872c3c924fefad34c4d82fe7fa4122f6aa4a | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 3 10:06:08 2019
@author: abinash boruah
"""
import numpy as np
import matplotlib.pyplot as plt
def sign(x):
l=[]
for i in x:
if i>0:
l1=1
l.append(l1)
else:
l2=0
l.append(l2)
... | 15.36 | 36 | 0.466146 |
bad7b13c5c6da7879bb27515660990d401cec8b0 | 2,733 | py | Python | src/mlpro/rl/pool/envs/multigeorobot/multigeorobot.py | fhswf/MLPro | e944b69bed9c2d5548677711270e4a4fe868aea9 | [
"Apache-2.0"
] | 5 | 2022-01-31T15:52:19.000Z | 2022-03-21T18:34:27.000Z | src/mlpro/rl/pool/envs/multigeorobot/multigeorobot.py | fhswf/MLPro | e944b69bed9c2d5548677711270e4a4fe868aea9 | [
"Apache-2.0"
] | 61 | 2021-12-17T13:03:59.000Z | 2022-03-31T10:24:37.000Z | src/mlpro/rl/pool/envs/multigeorobot/multigeorobot.py | fhswf/MLPro | e944b69bed9c2d5548677711270e4a4fe868aea9 | [
"Apache-2.0"
] | null | null | null | ## -------------------------------------------------------------------------------------------------
## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks
## -- Package : mlpro
## -- Module : multigeorobot.py
## ----------------------------------------------------------------------------... | 39.042857 | 100 | 0.555434 |
35a046f8d8366225d17fd3244dffb297cbc03c8f | 337 | py | Python | test/__init__.py | elwirth/cgavi | ceeba31bfc28ea3a32476677041c4b9e9ed59dbc | [
"MIT"
] | null | null | null | test/__init__.py | elwirth/cgavi | ceeba31bfc28ea3a32476677041c4b9e9ed59dbc | [
"MIT"
] | null | null | null | test/__init__.py | elwirth/cgavi | ceeba31bfc28ea3a32476677041c4b9e9ed59dbc | [
"MIT"
] | null | null | null | # To run all the tests, run: python -m unittest in the terminal in the project directory.
from os.path import dirname, basename, isfile, join
import glob
# makes the modules easily loadable
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswit... | 42.125 | 92 | 0.735905 |
e7d7cd028d97a95271462da815ef9d0eba6b3d7a | 2,121 | py | Python | pyqtgraph/graphicsItems/GraphicsWidget.py | hishizuka/pyqtgraph | 4820625d93ffb41f324431d0d29b395cf91f339e | [
"MIT"
] | 2,762 | 2015-01-02T14:34:10.000Z | 2022-03-30T14:06:07.000Z | pyqtgraph/graphicsItems/GraphicsWidget.py | hishizuka/pyqtgraph | 4820625d93ffb41f324431d0d29b395cf91f339e | [
"MIT"
] | 1,901 | 2015-01-12T03:20:30.000Z | 2022-03-31T16:33:36.000Z | pyqtgraph/graphicsItems/GraphicsWidget.py | hishizuka/pyqtgraph | 4820625d93ffb41f324431d0d29b395cf91f339e | [
"MIT"
] | 1,038 | 2015-01-01T04:05:49.000Z | 2022-03-31T11:57:51.000Z | # -*- coding: utf-8 -*-
from ..Qt import QtGui
from .GraphicsItem import GraphicsItem
__all__ = ['GraphicsWidget']
class GraphicsWidget(GraphicsItem, QtGui.QGraphicsWidget):
_qtBaseClass = QtGui.QGraphicsWidget
def __init__(self, *args, **kargs):
"""
**Bases:** :class:`GraphicsItem <pyqtg... | 36.568966 | 106 | 0.649222 |
e4841314effe514e33d22b8ba23cd0f37b1e78c6 | 301 | py | Python | data/multilingual/Latn.YAO/Mono_8/pdf_to_json_test_Latn.YAO_Mono_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | 1 | 2021-09-19T19:47:35.000Z | 2021-09-19T19:47:35.000Z | data/multilingual/Latn.YAO/Mono_8/pdf_to_json_test_Latn.YAO_Mono_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | data/multilingual/Latn.YAO/Mono_8/pdf_to_json_test_Latn.YAO_Mono_8.py | antoinecarme/pdf_to_json_tests | d57a024fde862e698d916a1178f285883d7a3b2f | [
"BSD-3-Clause"
] | null | null | null | import pdf_to_json as p2j
import json
url = "file:data/multilingual/Latn.YAO/Mono_8/udhr_Latn.YAO_Mono_8.pdf"
lConverter = p2j.pdf_to_json.pdf_to_json_converter()
lConverter.mImageHashOnly = True
lDict = lConverter.convert(url)
print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
| 30.1 | 71 | 0.810631 |
a09c741f358fcfeccbe544463ce71221fb5c298f | 11,857 | py | Python | vpc_core_infra/vpcx_cdk/vpc_stack.py | aws-samples/amz-vpc-provisioning-api-sls | d6779d24f8f0aa46e53cee17b7d94af401daeb18 | [
"MIT-0"
] | null | null | null | vpc_core_infra/vpcx_cdk/vpc_stack.py | aws-samples/amz-vpc-provisioning-api-sls | d6779d24f8f0aa46e53cee17b7d94af401daeb18 | [
"MIT-0"
] | null | null | null | vpc_core_infra/vpcx_cdk/vpc_stack.py | aws-samples/amz-vpc-provisioning-api-sls | d6779d24f8f0aa46e53cee17b7d94af401daeb18 | [
"MIT-0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
# pylint: disable=line-too-long
"""Class to handle the Cloudformatiom stack template creation"""
from aws_cdk import (
aws_ec2 as ec2,
core
)
from typing import List
from .vpc_context import VpcContext, VpcTyp... | 41.313589 | 117 | 0.540609 |
4055cdfa21aa11ab634b64d4e57757b53359d115 | 4,038 | py | Python | pysnmp/NETSCREEN-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/NETSCREEN-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/NETSCREEN-SMI.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 NETSCREEN-SMI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NETSCREEN-SMI
# Produced by pysmi-0.3.4 at Mon Apr 29 20:10:13 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 98.487805 | 816 | 0.757553 |
6edbedce54cf297b59ed831a082e27c67444f149 | 16,107 | py | Python | xarray/coding/times.py | plogerais/xarray | 0f70a876759197388d32d6d9f0317f0fe63e0336 | [
"Apache-2.0"
] | 2 | 2019-03-11T12:37:15.000Z | 2021-07-16T15:09:41.000Z | xarray/coding/times.py | plogerais/xarray | 0f70a876759197388d32d6d9f0317f0fe63e0336 | [
"Apache-2.0"
] | 2 | 2018-10-04T06:56:42.000Z | 2018-10-04T07:11:13.000Z | xarray/coding/times.py | plogerais/xarray | 0f70a876759197388d32d6d9f0317f0fe63e0336 | [
"Apache-2.0"
] | 1 | 2019-12-02T09:29:55.000Z | 2019-12-02T09:29:55.000Z | from __future__ import absolute_import, division, print_function
import re
import traceback
import warnings
from datetime import datetime
from functools import partial
import numpy as np
import pandas as pd
from ..core.common import contains_cftime_datetimes
from ..core import indexing
from ..core.formatting import ... | 36.773973 | 79 | 0.65276 |
28ee980144cf40d4b09a15d28fedf4bfd93fb3d4 | 5,201 | py | Python | appGUI/VisPyPatches.py | DannyPol/flatcam | 25a8634d0658e98b7fae31a095f8bef40c1b3067 | [
"MIT"
] | 1 | 2022-02-11T06:19:34.000Z | 2022-02-11T06:19:34.000Z | appGUI/VisPyPatches.py | MRemy2/FlatCam | d4f941335ca8a8d5351aab23b396f99da06a9029 | [
"MIT"
] | null | null | null | appGUI/VisPyPatches.py | MRemy2/FlatCam | d4f941335ca8a8d5351aab23b396f99da06a9029 | [
"MIT"
] | null | null | null | # ##########################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence ... | 37.688406 | 82 | 0.553355 |
bb7b326477a776068c3c1b9d08b2057ede1c776c | 3,773 | py | Python | test_ariac/test_example_node.py | ashfaqfarooqui/ariac | 6f36a992bec947a9be1b91673969e3a1b3369fd8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test_ariac/test_example_node.py | ashfaqfarooqui/ariac | 6f36a992bec947a9be1b91673969e3a1b3369fd8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test_ariac/test_example_node.py | ashfaqfarooqui/ariac | 6f36a992bec947a9be1b91673969e3a1b3369fd8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import sys
import time
import unittest
from ariac_example import ariac_example
from std_msgs.msg import Float32
import rospy
import rostest
class ExampleNodeTester(unittest.TestCase):
def comp_score_callback(self, msg):
self.current_comp_scor... | 36.990196 | 105 | 0.67506 |
cee12bfb287aeefc4e9835fea35cdbc3322230a9 | 648 | py | Python | backend/contest/views.py | cjc7373/hackergame | 86971b4cf8a2761044d417b4c8bd934c3309d6fd | [
"MIT"
] | 2 | 2020-07-12T13:11:43.000Z | 2020-07-14T08:12:17.000Z | backend/contest/views.py | cjc7373/hackergame | 86971b4cf8a2761044d417b4c8bd934c3309d6fd | [
"MIT"
] | 1 | 2020-08-13T13:56:18.000Z | 2020-09-29T12:39:08.000Z | backend/contest/views.py | cjc7373/hackergame | 86971b4cf8a2761044d417b4c8bd934c3309d6fd | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from contest.models import Stage, Pause
from contest.serializer import StageSerializer, PauseSerializer
class StageAPI(APIView):
def get(self, request):
stage = Stage.objects.get()
stage_serializer = StageSerial... | 30.857143 | 74 | 0.731481 |
14bb8c23d430174e99292b327533383c8b25ea0b | 20,476 | py | Python | official/nlp/modeling/layers/transformer_scaffold_test.py | lorynebissuel/models | 7f597cf851c793ce1b8db7a93a94894b04424d4c | [
"Apache-2.0"
] | 2 | 2021-04-02T12:21:35.000Z | 2021-12-14T07:29:38.000Z | official/nlp/modeling/layers/transformer_scaffold_test.py | lorynebissuel/models | 7f597cf851c793ce1b8db7a93a94894b04424d4c | [
"Apache-2.0"
] | null | null | null | official/nlp/modeling/layers/transformer_scaffold_test.py | lorynebissuel/models | 7f597cf851c793ce1b8db7a93a94894b04424d4c | [
"Apache-2.0"
] | 3 | 2019-11-12T11:18:11.000Z | 2021-12-29T09:14:37.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.14902 | 101 | 0.712883 |
c2c26ec98703599334d84658ce985159b5931b89 | 4,316 | py | Python | data/split_data.py | MattAshman/pvi | 74322ac23efd2674e46c953e5573d19d8d6bce4c | [
"MIT"
] | 1 | 2022-03-17T00:41:27.000Z | 2022-03-17T00:41:27.000Z | data/split_data.py | MattAshman/pvi | 74322ac23efd2674e46c953e5573d19d8d6bce4c | [
"MIT"
] | null | null | null | data/split_data.py | MattAshman/pvi | 74322ac23efd2674e46c953e5573d19d8d6bce4c | [
"MIT"
] | 1 | 2022-03-17T10:53:03.000Z | 2022-03-17T10:53:03.000Z | import numpy as np
def homogenous(x, y, m, dataset_seed):
"""
Homogenous split of the data into m groups.
"""
random_state = np.random.get_state()
if dataset_seed is not None:
np.random.seed(dataset_seed)
if m == 1:
client_data = [{"x": x, "y": y}]
return client_data
... | 30.828571 | 78 | 0.641566 |
4e6877fc69eea22a5935206f580611d15b564930 | 149 | py | Python | HackerRank/list2.py | SomuSysAdmin/python | 7707a6ebe54d8ad73aabe64836ec898c5fd7725d | [
"MIT"
] | null | null | null | HackerRank/list2.py | SomuSysAdmin/python | 7707a6ebe54d8ad73aabe64836ec898c5fd7725d | [
"MIT"
] | null | null | null | HackerRank/list2.py | SomuSysAdmin/python | 7707a6ebe54d8ad73aabe64836ec898c5fd7725d | [
"MIT"
] | null | null | null | if __name__ == '__main__':
n = int(input())
integer_list = map(int, input().split())
t = tuple(list(integer_list)[:n])
print(hash(t)) | 29.8 | 44 | 0.590604 |
844db8a8a3e7cc28f5862ac5b7855fc985e74af6 | 14,241 | py | Python | src/borg/testsuite/__init__.py | alfredo08154711/borg | 303c11f245e0a23e522a53aaad8cbeaaa2074551 | [
"BSD-3-Clause"
] | 1 | 2020-10-24T09:47:20.000Z | 2020-10-24T09:47:20.000Z | src/borg/testsuite/__init__.py | alfredo08154711/borg | 303c11f245e0a23e522a53aaad8cbeaaa2074551 | [
"BSD-3-Clause"
] | 1 | 2020-11-01T15:50:16.000Z | 2020-11-01T15:50:16.000Z | src/borg/testsuite/__init__.py | alfredo08154711/borg | 303c11f245e0a23e522a53aaad8cbeaaa2074551 | [
"BSD-3-Clause"
] | null | null | null | from contextlib import contextmanager
import filecmp
import functools
import os
try:
import posix
except ImportError:
posix = None
import stat
import sys
import sysconfig
import tempfile
import time
import uuid
import unittest
from ..xattr import get_all
from ..platform import get_flags
from ..helpers import ... | 36.703608 | 126 | 0.607261 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.