hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aadeedeee12237575f8cdcec6f32a2ad4677f9c5 | 11,329 | py | Python | test/e2e/tests/test_bucket.py | vijtrip2/s3-controller | b1a21ab237746646255b78412bcbfcd249b72f61 | [
"Apache-2.0"
] | null | null | null | test/e2e/tests/test_bucket.py | vijtrip2/s3-controller | b1a21ab237746646255b78412bcbfcd249b72f61 | [
"Apache-2.0"
] | null | null | null | test/e2e/tests/test_bucket.py | vijtrip2/s3-controller | b1a21ab237746646255b78412bcbfcd249b72f61 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may
# not use this file except in compliance with the License. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanyin... | 38.016779 | 109 | 0.713655 | # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may
# not use this file except in compliance with the License. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanyin... | 0 | 8,107 | 0 | 0 | 0 | 1,875 | 0 | 168 | 451 |
4653c46601b0d10d1b8237b0bec1d4bfbfd387d8 | 987 | py | Python | finetuned/sphere.py | vineeths96/Video-Interpolation-using-Deep-Optical-Flow | 5dd536bcc2d6c0d0d1718dccb09eb71ca77d2d94 | [
"MIT"
] | 5 | 2021-04-17T15:26:29.000Z | 2021-10-11T13:17:56.000Z | finetuned/sphere.py | vineeths96/Video-Interpolation-using-Deep-Optical-Flow | 5dd536bcc2d6c0d0d1718dccb09eb71ca77d2d94 | [
"MIT"
] | null | null | null | finetuned/sphere.py | vineeths96/Video-Interpolation-using-Deep-Optical-Flow | 5dd536bcc2d6c0d0d1718dccb09eb71ca77d2d94 | [
"MIT"
] | 2 | 2021-11-28T06:40:23.000Z | 2022-01-17T12:20:21.000Z | import glob
import cv2
import regex as re
from .deep_optical_flow import deep_optical_flow
from .interpolations import warp_flow
def sphere_interpolation(model_path="./flownet2/pretrained_models/FlowNet2_checkpoint.pth.tar"):
"""
Sphere dataset interpolation of Frame N+1 from Frame N and Frame N+2
:param ... | 36.555556 | 111 | 0.707194 | import glob
import cv2
import regex as re
from .deep_optical_flow import deep_optical_flow
from .interpolations import warp_flow
from .parameters import *
def sphere_interpolation(model_path="./flownet2/pretrained_models/FlowNet2_checkpoint.pth.tar"):
"""
Sphere dataset interpolation of Frame N+1 from Frame N... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
875c50a031df3d5ca588d2664761bc39b8ece01c | 9,363 | py | Python | kloppy/infra/serializers/tracking/secondspectrum.py | benoitblanc/kloppy | 5c3f94ff8806f9e23f8bad095a948a403a06a54c | [
"BSD-3-Clause"
] | null | null | null | kloppy/infra/serializers/tracking/secondspectrum.py | benoitblanc/kloppy | 5c3f94ff8806f9e23f8bad095a948a403a06a54c | [
"BSD-3-Clause"
] | null | null | null | kloppy/infra/serializers/tracking/secondspectrum.py | benoitblanc/kloppy | 5c3f94ff8806f9e23f8bad095a948a403a06a54c | [
"BSD-3-Clause"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 35.736641 | 109 | 0.522162 | import json
import logging
from typing import Tuple, Dict, Optional, Union, NamedTuple, IO
from lxml import objectify
from kloppy.domain import (
TrackingDataset,
DatasetFlag,
AttackingDirection,
Frame,
Point,
Point3D,
Team,
BallState,
Period,
Provider,
Orientation,
att... | 0 | 1,851 | 0 | 6,853 | 0 | 0 | 0 | 422 | 182 |
124e4f0bae283d78713ff0d955d4def0bcc6fe58 | 4,091 | py | Python | home-assistant/custom_components/meteo-swiss/config_flow.py | twhite96/smart-home-setup | 25222e26b770275b43f227b45cf7e0f8ba749595 | [
"MIT"
] | 190 | 2020-05-03T21:13:00.000Z | 2022-03-31T23:16:30.000Z | home-assistant/custom_components/meteo-swiss/config_flow.py | heinoskov/smart-home-setup | 896d1f09bfd7059681f7b0b0f1935159dd12b512 | [
"MIT"
] | 11 | 2020-11-20T10:57:00.000Z | 2022-03-18T07:42:43.000Z | home-assistant/custom_components/meteo-swiss/config_flow.py | heinoskov/smart-home-setup | 896d1f09bfd7059681f7b0b0f1935159dd12b512 | [
"MIT"
] | 21 | 2020-10-02T14:44:06.000Z | 2022-02-27T10:50:08.000Z | """Config flow to configure the Meteo-Swiss integration."""
import logging
_LOGGER = logging.getLogger(__name__)
| 37.87963 | 135 | 0.644341 | """Config flow to configure the Meteo-Swiss integration."""
import logging
import re
import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant import config_entries
from homeassistant.core import callback
from .const import DOMAIN,CONF_POSTCODE,CONF_STATION,CO... | 0 | 621 | 2,670 | 358 | 0 | 0 | 0 | 147 | 178 |
a04c3f1060786937b154ac2f4bf2b64f1b4b9af4 | 1,969 | py | Python | chips/utils/block_diagram.py | dillonhuff/Chips-2.0 | c78df1597b5f6b024723c4804c6797e4b00387ca | [
"MIT"
] | 221 | 2015-02-23T20:03:29.000Z | 2021-12-23T13:08:24.000Z | chips/utils/block_diagram.py | dillonhuff/Chips-2.0 | c78df1597b5f6b024723c4804c6797e4b00387ca | [
"MIT"
] | 10 | 2015-10-08T14:30:31.000Z | 2019-04-28T04:42:44.000Z | chips/utils/block_diagram.py | dawsonjon/Chips-2.0 | 57a986b8df36248bb4736bd84e3e68046b8665af | [
"MIT"
] | 31 | 2015-10-31T00:51:03.000Z | 2021-09-06T15:40:58.000Z |
if __name__ == "__main__":
c = Chip("my_chip")
a = Input(c, "a")
b = Input(c, "b")
d = Input(c, "d")
e = Input(c, "e")
x, y = tee(c, add(c, add(c, a, b), add(c, d, e)))
discard(c, x)
discard(c, y)
b = BlockDiagram(c)
b.view()
| 29.38806 | 72 | 0.504317 | from graphviz import Digraph
class BlockDiagram():
def __init__(self, chip):
self.chip = chip
g = Digraph(self.chip.name, graph_attr={"rankdir": "LR"})
sources = {}
sinks = {}
for instance in self.chip.instances:
for port, wire in instance.inputs.iteritems(... | 0 | 0 | 0 | 1,570 | 0 | 0 | 0 | 33 | 97 |
60a49c861da6feae6b72110e74da55a2ab442def | 852 | py | Python | src/the_tale/the_tale/game/companions/meta_relations.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/game/companions/meta_relations.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/game/companions/meta_relations.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z |
import smart_imports
smart_imports.all()
| 23.027027 | 63 | 0.656103 |
import smart_imports
smart_imports.all()
class Companion(meta_relations_objects.MetaType):
__slots__ = ('caption', )
TYPE = 6
TYPE_CAPTION = 'Спутник'
def __init__(self, caption, **kwargs):
super(Companion, self).__init__(**kwargs)
self.caption = caption
@property
def url(s... | 14 | 452 | 0 | 326 | 0 | 0 | 0 | 0 | 23 |
a54fd76006cf7246fec8458be45888fd3ea922be | 920 | py | Python | notify.py | crablab/hackney-ipp | eb011365389202ec90f4d5c57fd864c0e59c2d78 | [
"MIT"
] | 2 | 2020-06-07T21:28:54.000Z | 2020-09-02T16:11:59.000Z | notify.py | crablab/hackney-ipp | eb011365389202ec90f4d5c57fd864c0e59c2d78 | [
"MIT"
] | null | null | null | notify.py | crablab/hackney-ipp | eb011365389202ec90f4d5c57fd864c0e59c2d78 | [
"MIT"
] | null | null | null | import cuid, sys, os
from dotenv import load_dotenv
from notifications_python_client.notifications import NotificationsAPIClient
# Load .env
load_dotenv()
# Set up a new Notify client
notifications_client = NotificationsAPIClient(os.getenv("NOTIFY_KEY"))
# Generate a unique reference
id_gen = cuid.CuidGenerator()
... | 28.75 | 96 | 0.745652 | import cuid, sys, os
from dotenv import load_dotenv
from notifications_python_client.notifications import NotificationsAPIClient
# Load .env
load_dotenv()
# Set up a new Notify client
notifications_client = NotificationsAPIClient(os.getenv("NOTIFY_KEY"))
# Generate a unique reference
id_gen = cuid.CuidGenerator()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17f2d50a4262facd9daff3b661d550302005ac42 | 460 | py | Python | src/python_lib_for_me/list.py | silverag-corgi/python-lib-for-me | ed30c7b879396ca6af53c762d7c919b0ea44bea7 | [
"MIT"
] | null | null | null | src/python_lib_for_me/list.py | silverag-corgi/python-lib-for-me | ed30c7b879396ca6af53c762d7c919b0ea44bea7 | [
"MIT"
] | 1 | 2022-02-06T08:21:56.000Z | 2022-02-06T15:48:26.000Z | src/python_lib_for_me/list.py | silverag-corgi/python-lib-for-me | ed30c7b879396ca6af53c762d7c919b0ea44bea7 | [
"MIT"
] | null | null | null | '''
'''
def split_list(elements: list, num_of_elements: int) -> list[list]:
'''
Args:
elements (list) :
num_of_elements (int) :
Returns:
list[list]:
'''
items_list: list[list] = \
[elements[index : index + num_of_e... | 20 | 68 | 0.526087 | '''
リストモジュール
'''
def split_list(elements: list, num_of_elements: int) -> list[list]:
'''
リスト分割
Args:
elements (list) : 要素リスト
num_of_elements (int) : 分割単位の要素数
Returns:
list[list]: 分割結果リスト
'''
items_list: list[list] = \
[... | 99 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
22c8b2bbccd08a3508fd4d200508de71b852595e | 230 | py | Python | course3/lesson1/adder.py | dbrandenburg/python-oreilley-certification | 44af77d093100971e32d48b309f8d6e6d1b78364 | [
"Apache-2.0"
] | null | null | null | course3/lesson1/adder.py | dbrandenburg/python-oreilley-certification | 44af77d093100971e32d48b309f8d6e6d1b78364 | [
"Apache-2.0"
] | null | null | null | course3/lesson1/adder.py | dbrandenburg/python-oreilley-certification | 44af77d093100971e32d48b309f8d6e6d1b78364 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
def object_adder(a, b):
"""Adds two object together"""
if type(a) is not int or type(b) is not int:
raise TypeError("Object is not of type int")
return a + b
import sys
print(sys.argv)
| 20.909091 | 52 | 0.63913 | #!/usr/bin/env python3
def object_adder(a, b):
"""Adds two object together"""
if type(a) is not int or type(b) is not int:
raise TypeError("Object is not of type int")
return a + b
import sys
print(sys.argv)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a41459805297a3f06d4342530f581db1c689df22 | 6,044 | py | Python | yatube/posts/tests/test_urls.py | Ecmek/yatube_project | 24206ad81c73c184e0f24ca7242c3f8233278592 | [
"BSD-3-Clause"
] | 1 | 2021-08-17T07:30:35.000Z | 2021-08-17T07:30:35.000Z | yatube/posts/tests/test_urls.py | Ecmek/yatube_project | 24206ad81c73c184e0f24ca7242c3f8233278592 | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/tests/test_urls.py | Ecmek/yatube_project | 24206ad81c73c184e0f24ca7242c3f8233278592 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth import get_user_model
User = get_user_model()
index = '/'
group = 'group'
test_slug = 'test_slug'
fake_slug = 'fake_slug'
new_post = 'new'
post_edit = 'edit'
post_delete = 'delete'
follow_index = 'follow'
profile_follow = 'follow'
profile_unfollow = 'unfollow'
post_author = 'post_author'
anot... | 38.253165 | 79 | 0.595963 | from django.contrib.auth import get_user_model
from django.test import TestCase, Client
from django.core.cache import cache
from posts.models import Post, Group
User = get_user_model()
index = '/'
group = 'group'
test_slug = 'test_slug'
fake_slug = 'fake_slug'
new_post = 'new'
post_edit = 'edit'
post_delete = 'delet... | 1,088 | 602 | 0 | 4,364 | 0 | 0 | 0 | 48 | 90 |
5e2a3eca705b4a75c88e80e14b7a803235508b60 | 1,045 | py | Python | rpython/jit/backend/arm/detect.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2016-07-06T23:30:20.000Z | 2017-05-30T15:59:31.000Z | rpython/jit/backend/arm/detect.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | null | null | null | rpython/jit/backend/arm/detect.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2020-07-09T08:14:22.000Z | 2021-01-15T18:01:25.000Z | from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.rtyper.tool import rffi_platform
from rpython.translator.platform import CompilationError
eci = ExternalCompilationInfo(
post_include_bits=["""
// we need to disable optimizations so the compiler does not remove this
// function when c... | 32.65625 | 73 | 0.735885 | from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rtyper.tool import rffi_platform
from rpython.translator.platform import CompilationError
eci = ExternalCompilationInfo(
post_include_bits=["""
// we need to disable optimizations so... | 0 | 0 | 0 | 0 | 0 | 203 | 0 | 31 | 45 |
d5d782f07d49524242d5d7d49587dfa75702b348 | 2,892 | py | Python | source/07/mc-7-5-tp-cde-hd.py | schef/schef.github.io | ac6fc70e5077deeeb8233ede89e0895fdc2a0d05 | [
"MIT"
] | null | null | null | source/07/mc-7-5-tp-cde-hd.py | schef/schef.github.io | ac6fc70e5077deeeb8233ede89e0895fdc2a0d05 | [
"MIT"
] | null | null | null | source/07/mc-7-5-tp-cde-hd.py | schef/schef.github.io | ac6fc70e5077deeeb8233ede89e0895fdc2a0d05 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Written by Stjepan Horvat
# ( zvanstefan@gmail.com )
# by the exercises from David Lucal Burge - Perfect Pitch Ear Traning Supercourse
# Thanks to Wojciech M. Zabolotny ( wzab@ise.pw.edu.pl ) for snd-virmidi example
# ( wzab@ise.pw.edu.pl )
import random
import re
fname="/dev/snd/midiC2D0"
#fname=... | 27.283019 | 155 | 0.603389 | #!/usr/bin/python
# Written by Stjepan Horvat
# ( zvanstefan@gmail.com )
# by the exercises from David Lucal Burge - Perfect Pitch Ear Traning Supercourse
# Thanks to Wojciech M. Zabolotny ( wzab@ise.pw.edu.pl ) for snd-virmidi example
# ( wzab@ise.pw.edu.pl )
import random
import time
import sys
import re
fname="/de... | 0 | 0 | 0 | 0 | 0 | 859 | 0 | -21 | 136 |
fb2b284ea4ef5aaab01e5a4a4aad1fc067550c17 | 720 | py | Python | tests/test_accmip6.py | pkufubo/acccmip6 | 762200f314a26b4e0eeb971b607c1b3a81a57d30 | [
"MIT"
] | 59 | 2019-09-19T10:01:00.000Z | 2022-03-31T07:05:00.000Z | tests/test_accmip6.py | pkufubo/acccmip6 | 762200f314a26b4e0eeb971b607c1b3a81a57d30 | [
"MIT"
] | 6 | 2020-11-19T08:58:23.000Z | 2022-02-07T12:57:23.000Z | tests/test_accmip6.py | pkufubo/acccmip6 | 762200f314a26b4e0eeb971b607c1b3a81a57d30 | [
"MIT"
] | 10 | 2019-11-24T15:39:59.000Z | 2022-01-22T08:58:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_accmip6
----------------------------------
Tests for `accmip6` module.
"""
| 25.714286 | 94 | 0.604167 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_accmip6
----------------------------------
Tests for `accmip6` module.
"""
import pytest
from pathlib import Path
from acccmip6.utilities.c6db import SearchDB
from acccmip6.utilities.util import _dir_path, _Construct_urls
def test_url_getter(... | 0 | 0 | 0 | 0 | 0 | 358 | 0 | 59 | 156 |
3069cb0d11663e532a2bd9872633694a80c03d36 | 2,385 | py | Python | Machines/OPENADMIN/ona-rce.py | limitedeternity/HackTheBox | ed8d6fc7ff7b880b1961098bedca1fc5fdf7fd09 | [
"MIT"
] | null | null | null | Machines/OPENADMIN/ona-rce.py | limitedeternity/HackTheBox | ed8d6fc7ff7b880b1961098bedca1fc5fdf7fd09 | [
"MIT"
] | null | null | null | Machines/OPENADMIN/ona-rce.py | limitedeternity/HackTheBox | ed8d6fc7ff7b880b1961098bedca1fc5fdf7fd09 | [
"MIT"
] | 3 | 2021-12-29T10:39:01.000Z | 2022-03-29T22:56:40.000Z | #!/usr/bin/python3
'''
# Exploit Title: OpenNetAdmin 18.1.1 - Remote Code Execution
# Date: 2020-01-18
# Exploit Author: @amriunix (https://amriunix.com)
# Vendor Homepage: http://opennetadmin.com/
# Software Link: https://github.com/opennetadmin/ona
# Version: v18.1.1
# Tested on: Linux
'''
import requests
import sy... | 33.591549 | 98 | 0.587841 | #!/usr/bin/python3
'''
# Exploit Title: OpenNetAdmin 18.1.1 - Remote Code Execution
# Date: 2020-01-18
# Exploit Author: @amriunix (https://amriunix.com)
# Vendor Homepage: http://opennetadmin.com/
# Software Link: https://github.com/opennetadmin/ona
# Version: v18.1.1
# Tested on: Linux
'''
import requests
import sy... | 0 | 0 | 0 | 0 | 0 | 904 | 0 | 0 | 67 |
42175e58c2c15f5ee99e556b90c3a5806c720a50 | 23,640 | py | Python | oneflow/python/nn/modules/activation.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | null | null | null | oneflow/python/nn/modules/activation.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | null | null | null | oneflow/python/nn/modules/activation.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"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... | 25.751634 | 89 | 0.544036 | """
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... | 0 | 21,854 | 0 | 0 | 0 | 403 | 0 | 134 | 569 |
b94570549fff0f323fca932142442f9e2286a38b | 1,362 | py | Python | demo/text_spotting/mask_rcnn_spot/configs/mask_rcnn_spotter_pretrain.py | icedream2/DAVAR-Lab-OCR | c8b82f45516850eeadcab2739fb2a4292f2fdca1 | [
"Apache-2.0"
] | null | null | null | demo/text_spotting/mask_rcnn_spot/configs/mask_rcnn_spotter_pretrain.py | icedream2/DAVAR-Lab-OCR | c8b82f45516850eeadcab2739fb2a4292f2fdca1 | [
"Apache-2.0"
] | null | null | null | demo/text_spotting/mask_rcnn_spot/configs/mask_rcnn_spotter_pretrain.py | icedream2/DAVAR-Lab-OCR | c8b82f45516850eeadcab2739fb2a4292f2fdca1 | [
"Apache-2.0"
] | null | null | null | """
####################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : mango_r50_ete_pretrain.py
# Abstract : Model settings for mask rcnn spotter end-to-en... | 34.923077 | 102 | 0.553598 | """
####################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : mango_r50_ete_pretrain.py
# Abstract : Model settings for mask rcnn spotter end-to-en... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
40b5da6d9b057ada5f1d37ec3aedaa657578ee0d | 3,906 | py | Python | mol_property/pka/data_utils.py | Mana-bio/mol_property | 16c83bf9c6c03e25695cc913c68ec23ff704f2bc | [
"MIT"
] | 8 | 2019-08-24T22:19:53.000Z | 2022-03-20T06:21:55.000Z | mol_property/pka/data_utils.py | Mana-bio/mol_property | 16c83bf9c6c03e25695cc913c68ec23ff704f2bc | [
"MIT"
] | 1 | 2021-09-08T20:43:06.000Z | 2021-09-26T22:38:51.000Z | mol_property/pka/data_utils.py | Mana-bio/mol_property | 16c83bf9c6c03e25695cc913c68ec23ff704f2bc | [
"MIT"
] | 5 | 2019-08-24T22:24:02.000Z | 2022-03-20T06:22:06.000Z | # -*- coding: utf-8 -*-
import os
DATA_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "./train/data/pKaInWater.csv")
| 40.268041 | 117 | 0.592678 | # -*- coding: utf-8 -*-
import os
import numpy as np
import pandas as pd
import rdkit
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem, Descriptors
DATA_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "./train/data/pKaInWater.csv")
def rdkit_numpy_convert(fp):
output = []
fo... | 0 | 679 | 0 | 2,737 | 0 | 174 | 0 | 22 | 156 |
0d7a3e5a79ba80bc82f905112ac0ea79d2da3cf1 | 531 | py | Python | src/options.py | StrinTH/DrHelp | 76cdcd549f6c8ad6315e5c4557793c622a833c6a | [
"MIT"
] | 1 | 2021-12-02T15:04:08.000Z | 2021-12-02T15:04:08.000Z | src/options.py | StrinTH/DrHelp | 76cdcd549f6c8ad6315e5c4557793c622a833c6a | [
"MIT"
] | null | null | null | src/options.py | StrinTH/DrHelp | 76cdcd549f6c8ad6315e5c4557793c622a833c6a | [
"MIT"
] | 1 | 2021-12-02T15:04:09.000Z | 2021-12-02T15:04:09.000Z | from default_data import default_data
values={1:str(default_data.sample_id),2:default_data.sample_type,3:default_data.report_type,4:default_data.doc_type }
set_options = {1:"id", 2:"type", 3:"report", 4:"doc"}
get_options = {1: "name", 2: "intro", 3: "gene", 4: "stem-loop", 5: "peptide", 6: "cds", 7: "source", 8: "comm... | 88.5 | 128 | 0.65725 | from default_data import default_data
values={1:str(default_data.sample_id),2:default_data.sample_type,3:default_data.report_type,4:default_data.doc_type }
set_options = {1:"id", 2:"type", 3:"report", 4:"doc"}
get_options = {1: "name", 2: "intro", 3: "gene", 4: "stem-loop", 5: "peptide", 6: "cds", 7: "source", 8: "comm... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
071e88c7c8b0ef8617a798c4d21554568522c26c | 13,856 | py | Python | bmtk/utils/sonata/file_root.py | tjbanks/bmtk | 52fee3b230ceb14a666c46f57f2031c38f1ac5b1 | [
"BSD-3-Clause"
] | 216 | 2017-10-03T17:02:42.000Z | 2022-03-20T03:35:48.000Z | bmtk/utils/sonata/file_root.py | tjbanks/bmtk | 52fee3b230ceb14a666c46f57f2031c38f1ac5b1 | [
"BSD-3-Clause"
] | 92 | 2018-03-19T10:14:18.000Z | 2022-01-29T15:21:47.000Z | bmtk/utils/sonata/file_root.py | tjbanks/bmtk | 52fee3b230ceb14a666c46f57f2031c38f1ac5b1 | [
"BSD-3-Clause"
] | 97 | 2017-10-03T22:15:06.000Z | 2022-03-23T21:03:26.000Z | # Copyright 2017. Allen Institute. All rights reserved
#
# 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 code must retain the above copyright notice, this list of conditions and the follow... | 45.880795 | 120 | 0.670612 | # Copyright 2017. Allen Institute. All rights reserved
#
# 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 code must retain the above copyright notice, this list of conditions and the follow... | 0 | 466 | 0 | 11,592 | 0 | 0 | 0 | 27 | 247 |
27a41e0d544a5c6660bd427e332b412facc45223 | 2,615 | py | Python | setup.py | wlang42/Products.CMFCore | 9e4872425c46b50b730750b230cfe7221bc2a7d4 | [
"ZPL-2.1"
] | null | null | null | setup.py | wlang42/Products.CMFCore | 9e4872425c46b50b730750b230cfe7221bc2a7d4 | [
"ZPL-2.1"
] | null | null | null | setup.py | wlang42/Products.CMFCore | 9e4872425c46b50b730750b230cfe7221bc2a7d4 | [
"ZPL-2.1"
] | null | null | null | import os
from setuptools import setup
from setuptools import find_packages
NAME = 'CMFCore'
here = os.path.abspath(os.path.dirname(__file__))
package = os.path.join(here, 'Products', NAME)
_boundary = '\n' + ('-' * 60) + '\n\n'
README = _boundary.join([
_package_doc('README.txt'),
_package_doc('CHANGES.tx... | 31.890244 | 89 | 0.587763 | import os
from setuptools import setup
from setuptools import find_packages
NAME = 'CMFCore'
here = os.path.abspath(os.path.dirname(__file__))
package = os.path.join(here, 'Products', NAME)
def _package_doc(name):
f = open(os.path.join(here, name))
return f.read()
_boundary = '\n' + ('-' * 60) + '\n\n'
RE... | 0 | 0 | 0 | 0 | 0 | 61 | 0 | 0 | 23 |
8c2f2b0b29a89361362b8c63b5f23ed318d65a4a | 3,030 | py | Python | nova/conf/osapi_v21.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/conf/osapi_v21.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/conf/osapi_v21.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2020-03-01T17:04:57.000Z | 2020-03-01T17:04:57.000Z | # Copyright 2015 OpenStack Foundation
# 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 requ... | 28.317757 | 79 | 0.709571 | # Copyright 2015 OpenStack Foundation
# 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 requ... | 0 | 0 | 0 | 0 | 0 | 125 | 0 | 0 | 46 |
bc50a54003ed4f378eba19789b209b5f23ec8ad4 | 1,813 | py | Python | SfM/Traditional/PnPRANSAC.py | akathpal/ComputerVision-CMSC733 | f5fa21a0ada8ab8ea08a6c558f6df9676570a2df | [
"MIT"
] | 1 | 2019-09-26T02:06:17.000Z | 2019-09-26T02:06:17.000Z | SfM/Traditional/PnPRANSAC.py | akathpal/UMD-CMSC733-ComputerVision | f5fa21a0ada8ab8ea08a6c558f6df9676570a2df | [
"MIT"
] | null | null | null | SfM/Traditional/PnPRANSAC.py | akathpal/UMD-CMSC733-ComputerVision | f5fa21a0ada8ab8ea08a6c558f6df9676570a2df | [
"MIT"
] | 1 | 2022-03-30T05:03:09.000Z | 2022-03-30T05:03:09.000Z | """Summary
"""
import numpy as np
import LinearPnP as LPnP
import random
from tqdm import tqdm
def proj3Dto2D(x3D, K, C, R):
"""Summary
Args:
x3D (TYPE): Description
K (TYPE): Description
C (TYPE): Description
R (TYPE): Description
Returns:
TYPE: Description
"... | 24.173333 | 68 | 0.498621 | """Summary
"""
import numpy as np
import LinearPnP as LPnP
import random
from tqdm import tqdm
def proj3Dto2D(x3D, K, C, R):
"""Summary
Args:
x3D (TYPE): Description
K (TYPE): Description
C (TYPE): Description
R (TYPE): Description
Returns:
TYPE: Description
"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
91209b23eab8a5ab7f587d0930191fdd2e862962 | 965 | py | Python | setup.py | mefsantos/branch-testing | 04c944950fc5d4ebafc32d27f7e08bd760b89e66 | [
"Unlicense"
] | null | null | null | setup.py | mefsantos/branch-testing | 04c944950fc5d4ebafc32d27f7e08bd760b89e66 | [
"Unlicense"
] | null | null | null | setup.py | mefsantos/branch-testing | 04c944950fc5d4ebafc32d27f7e08bd760b89e66 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
def friendly(command_subclass):
"""
A decorator for classes subclassing one of the setuptools commands.
It modifies the run() method so that it prints a friendly greeting.
"""
orig_run = command_subclass.run
command_subclass.run = modified_run
return co... | 21.931818 | 71 | 0.699482 | #!/usr/bin/env python
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
def friendly(command_subclass):
"""
A decorator for classes subclassing one of the setuptools commands.
It modifies the run() method so that it prints a friendly gre... | 0 | 57 | 0 | 0 | 0 | 48 | 0 | 50 | 91 |
be4cbce6f0215362dc8c07de53a409e097b2847d | 102 | py | Python | tests/__init__.py | iteg-hq/pystaticsql | cb2c61d49e5ef33c33c99f6f26da0e55b78696f2 | [
"MIT"
] | null | null | null | tests/__init__.py | iteg-hq/pystaticsql | cb2c61d49e5ef33c33c99f6f26da0e55b78696f2 | [
"MIT"
] | null | null | null | tests/__init__.py | iteg-hq/pystaticsql | cb2c61d49e5ef33c33c99f6f26da0e55b78696f2 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'staticsql')) | 25.5 | 80 | 0.764706 | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'staticsql')) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abb474a9f34b3f34295c3057977ccfd213b24757 | 2,576 | py | Python | source/_static/code/fasta_object.py | C3BI-pasteur-fr/python-solutions-1 | 4f476d4e8b636f9e4480437f776c528666fad96a | [
"CC0-1.0"
] | null | null | null | source/_static/code/fasta_object.py | C3BI-pasteur-fr/python-solutions-1 | 4f476d4e8b636f9e4480437f776c528666fad96a | [
"CC0-1.0"
] | null | null | null | source/_static/code/fasta_object.py | C3BI-pasteur-fr/python-solutions-1 | 4f476d4e8b636f9e4480437f776c528666fad96a | [
"CC0-1.0"
] | null | null | null |
if __name__ == '__main__':
import sys
import os.path
if len(sys.argv) != 2:
sys.exit("usage fasta_object fasta_path")
fasta_path = sys.argv[1]
if not os.path.exists(fasta_path):
sys.exit("No such file: {}".format(fasta_path))
fasta_parser = FastaParser(fasta_path)
for seq... | 32.2 | 74 | 0.53222 | class Sequence(object):
def __init__(self, id_, sequence, comment=''):
self.id = id_
self.comment = comment
self.sequence = sequence
def gc_percent(self):
seq = self.sequence.upper()
return float(seq.count('G') + seq.count('C')) / float(len(seq))
class FastaParser(obje... | 0 | 0 | 0 | 2,025 | 0 | 0 | 0 | 0 | 45 |
b9b417b80dc5364aedd894415852090ddedf5d18 | 568 | py | Python | ex034.py | AleLucasG/Estudos-Python-I | 4144033bb77b06dd1c9c56a36d5bb152295a6be6 | [
"MIT"
] | null | null | null | ex034.py | AleLucasG/Estudos-Python-I | 4144033bb77b06dd1c9c56a36d5bb152295a6be6 | [
"MIT"
] | null | null | null | ex034.py | AleLucasG/Estudos-Python-I | 4144033bb77b06dd1c9c56a36d5bb152295a6be6 | [
"MIT"
] | null | null | null | """ Escreva um programa que pergunte o salrio de um funcionrio e calcule o valor do seu aumento.
Para salrios superiores a R$1.250,00, calcule um aumento de 10%. Para os inferiores ou iguais, o aumento de 15%."""
salario = float(input('Qual valor do seu salario R$ '))
if salario <= 1249.99:
aumento = (salario * 1... | 33.411765 | 118 | 0.683099 | """ Escreva um programa que pergunte o salário de um funcionário e calcule o valor do seu aumento.
Para salários superiores a R$1.250,00, calcule um aumento de 10%. Para os inferiores ou iguais, o aumento é de 15%."""
salario = float(input('Qual valor do seu salario R$ '))
if salario <= 1249.99:
aumento = (salario... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4f8cf2874f900c610e1a276ea22e8e8ecd208a6f | 3,534 | py | Python | mev/api/public_data/sources/gdc/tcga.py | hsph-qbrc/mev-backend | c381800aa7d53d7256e89a4db5a0f9444264e9a6 | [
"MIT"
] | null | null | null | mev/api/public_data/sources/gdc/tcga.py | hsph-qbrc/mev-backend | c381800aa7d53d7256e89a4db5a0f9444264e9a6 | [
"MIT"
] | null | null | null | mev/api/public_data/sources/gdc/tcga.py | hsph-qbrc/mev-backend | c381800aa7d53d7256e89a4db5a0f9444264e9a6 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 33.028037 | 105 | 0.676853 | import copy
import re
import json
import logging
import requests
import datetime
import shutil
import os
import tarfile
import uuid
import pandas as pd
from django.conf import settings
from api.utilities.basic_utils import get_with_retry, \
make_local_directory
from .gdc import GDCDataSource, GDCRnaSeqDataSourc... | 0 | 0 | 0 | 3,123 | 0 | 0 | 0 | 22 | 336 |
3364b33b85badd5f70d904a4134808f39e3df4a1 | 3,996 | py | Python | tests/integration/states/test_ssh_auth.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 1 | 2021-09-06T00:14:04.000Z | 2021-09-06T00:14:04.000Z | tests/integration/states/test_ssh_auth.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 2 | 2021-04-30T21:17:57.000Z | 2021-12-13T20:40:23.000Z | tests/integration/states/test_ssh_auth.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Test the ssh_auth states
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import salt libs
# Import Salt Testing libs
| 35.678571 | 86 | 0.63013 | # -*- coding: utf-8 -*-
"""
Test the ssh_auth states
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
# Import salt libs
import salt.utils.files
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructi... | 0 | 3,375 | 0 | 39 | 0 | 0 | 0 | 150 | 231 |
6848665c432b401ac689c588426181ebbfd36cc1 | 232 | py | Python | service_user.py | RobinCAS/CircuitBreaker_py | 941314fec95671a6d5af49f884e585ea1d3a936a | [
"MIT"
] | null | null | null | service_user.py | RobinCAS/CircuitBreaker_py | 941314fec95671a6d5af49f884e585ea1d3a936a | [
"MIT"
] | 1 | 2017-01-05T02:25:25.000Z | 2017-01-05T02:25:25.000Z | service_user.py | RobinCAS/CircuitBreaker_py | 941314fec95671a6d5af49f884e585ea1d3a936a | [
"MIT"
] | null | null | null | """ service_user.py """
from flask import Flask
app = Flask(__name__)
if __name__ == "__main__":
app.run(port=3002, debug=True)
| 14.5 | 36 | 0.650862 | """ service_user.py """
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/user", methods=['GET'])
def get_user():
return jsonify(name='CAS')
if __name__ == "__main__":
app.run(port=3002, debug=True)
| 0 | 62 | 0 | 0 | 0 | 0 | 0 | 9 | 23 |
56a6a7bee984a8facda8deb4784fa15bd591ea52 | 2,911 | py | Python | src/shop/business/service.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/shop/business/service.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/shop/business/service.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | 35.938272 | 92 | 0.762625 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | 0 | 1,794 | 0 | 0 | 0 | 0 | 0 | 252 | 224 |
fe5748f4771bb5c4cdcf7a649ae541fa6ab87fb5 | 2,589 | py | Python | config.py | RetroCirce/Zero_Shot_Audio_Source_Separation | 16b5c2cc9f263c6d17894d433a2da31b07788f4d | [
"MIT"
] | 66 | 2021-12-25T17:09:21.000Z | 2022-03-31T08:15:51.000Z | config.py | RetroCirce/Zero_Shot_Audio_Source_Separation | 16b5c2cc9f263c6d17894d433a2da31b07788f4d | [
"MIT"
] | 13 | 2022-01-06T04:12:37.000Z | 2022-03-20T23:07:12.000Z | config.py | RetroCirce/Zero_Shot_Audio_Source_Separation | 16b5c2cc9f263c6d17894d433a2da31b07788f4d | [
"MIT"
] | 8 | 2022-02-02T17:42:38.000Z | 2022-03-27T09:12:06.000Z | # Ke Chen
# knutchen@ucsd.edu
# Zero-shot Audio Source Separation via Query-based Learning from Weakly-labeled Data
# The configuration file
# for model training
exp_name = "exp_zs_asp_full" # the saved ckpt prefix name of the model
workspace = "/home/Research/ZS_ASP/" # the folder of your code
dataset_path = "/home/... | 41.758065 | 144 | 0.759367 | # Ke Chen
# knutchen@ucsd.edu
# Zero-shot Audio Source Separation via Query-based Learning from Weakly-labeled Data
# The configuration file
# for model training
exp_name = "exp_zs_asp_full" # the saved ckpt prefix name of the model
workspace = "/home/Research/ZS_ASP/" # the folder of your code
dataset_path = "/home/... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
02f91dbb53c6aa165b7007d16cdc9f0a7517c844 | 39,932 | py | Python | projects/FashionNet/scripts/deepfashion2_to_shopee_coco.py | sm047/detectron2 | 1036cce320ce0f2adbce7f143566462d3222bd5a | [
"Apache-2.0"
] | 5 | 2020-06-16T11:31:22.000Z | 2021-11-08T03:07:47.000Z | projects/FashionNet/scripts/deepfashion2_to_shopee_coco.py | fangchengji/detectron2 | 1036cce320ce0f2adbce7f143566462d3222bd5a | [
"Apache-2.0"
] | null | null | null | projects/FashionNet/scripts/deepfashion2_to_shopee_coco.py | fangchengji/detectron2 | 1036cce320ce0f2adbce7f143566462d3222bd5a | [
"Apache-2.0"
] | null | null | null | import json
from PIL import Image
import numpy as np
import os
import random
dataset = {
"info": {},
"licenses": [],
"images": [],
"annotations": [],
"annotations2": [],
"categories": [],
"categories2": []
}
dataset['categories'].append({
'id': 1,
'name': "short_sleeved_shirt",
... | 90.548753 | 1,968 | 0.425548 | import json
from PIL import Image
import numpy as np
import shutil
import os
import random
dataset = {
"info": {},
"licenses": [],
"images": [],
"annotations": [],
"annotations2": [],
"categories": [],
"categories2": []
}
dataset['categories'].append({
'id': 1,
'name': "short_sleev... | 0 | 0 | 0 | 202 | 0 | 3,239 | 0 | -8 | 136 |
fe23fff39b7dd739ed6401f91a2cedc997fe08c6 | 1,606 | py | Python | feishu/api_drive_doc.py | crisone/feishu-python-sdk | 36a610926553f0fc5325c87d3955fde5f5d417be | [
"MIT"
] | 44 | 2020-08-11T04:35:53.000Z | 2022-03-09T16:23:55.000Z | feishu/api_drive_doc.py | crisone/feishu-python-sdk | 36a610926553f0fc5325c87d3955fde5f5d417be | [
"MIT"
] | 2 | 2020-10-21T08:07:20.000Z | 2021-09-10T08:42:03.000Z | feishu/api_drive_doc.py | crisone/feishu-python-sdk | 36a610926553f0fc5325c87d3955fde5f5d417be | [
"MIT"
] | 12 | 2020-10-01T07:00:31.000Z | 2022-03-13T14:59:06.000Z | # coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 30.884615 | 89 | 0.684309 | # coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from typing import TYPE_CHECKING
from feishu.dt_drive import DriveDocFileMeta
from feishu.dt_help import make_datatype
if TYPE_CHECKING:
from feishu.api import OpenLark
class APIDriveDocMixin(object):
def ge... | 246 | 0 | 0 | 1,224 | 0 | 0 | 0 | 52 | 94 |
631d0ad57e7f9c8b7dcf51cf4207ed5358680427 | 1,855 | py | Python | GameElements/boardgame.py | glauberdmo/game-project | 835a3b23a3605dc0070615962e636c754cb6c0c5 | [
"Unlicense"
] | null | null | null | GameElements/boardgame.py | glauberdmo/game-project | 835a3b23a3605dc0070615962e636c754cb6c0c5 | [
"Unlicense"
] | null | null | null | GameElements/boardgame.py | glauberdmo/game-project | 835a3b23a3605dc0070615962e636c754cb6c0c5 | [
"Unlicense"
] | null | null | null |
EMPTY_SYMBOL = "_"
| 28.106061 | 71 | 0.563342 | from typing import List
import numpy as np
EMPTY_SYMBOL = "_"
class Boardgame:
def __init__(self, board_h:int, board_w:int):
#boardgame is a 2d numpy array
self.board_h = board_h
self.board_w = board_w
self.board = np.zeros((board_h, board_w), dtype=str)
self.board.fill(EM... | 0 | 0 | 0 | 1,742 | 0 | 0 | 0 | -1 | 67 |
21eab977b3a2d85635e8b4aca52f5e2b2a884b9e | 56 | py | Python | 04/01/instance_method/timetz.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | 04/01/instance_method/timetz.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | 32 | 2017-09-01T00:52:17.000Z | 2017-10-01T00:30:02.000Z | 04/01/instance_method/timetz.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | import datetime
print(datetime.datetime.now().timetz())
| 18.666667 | 39 | 0.785714 | import datetime
print(datetime.datetime.now().timetz())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2faf25ff3604020d474509c409ccb362674d5d4d | 753 | py | Python | audiotype/MockAudioType.py | monsdar/Mubox | e06e73903b1b7fdd8da48b6189b238ee25a57242 | [
"MIT"
] | null | null | null | audiotype/MockAudioType.py | monsdar/Mubox | e06e73903b1b7fdd8da48b6189b238ee25a57242 | [
"MIT"
] | null | null | null | audiotype/MockAudioType.py | monsdar/Mubox | e06e73903b1b7fdd8da48b6189b238ee25a57242 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
This AudioType only prints some info onto the console
''' | 30.12 | 83 | 0.658699 | #!/usr/bin/env python3
'''
This AudioType only prints some info onto the console
'''
import logging
from audiotype.IAudioType import IAudioType
class MockAudioType(IAudioType):
def __init__(self):
self.currentTag = ""
self.currentConfig = None
self.logger = logging.getLogger("mubox.MockAu... | 0 | 0 | 0 | 585 | 0 | 0 | 0 | 15 | 68 |
0eba93c3d67b55a38cc6f97c9b04103a070a3ad1 | 498 | py | Python | backend/apps/banking/migrations/0005_auto_20200606_1325.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | 1 | 2020-07-06T12:34:50.000Z | 2020-07-06T12:34:50.000Z | backend/apps/banking/migrations/0005_auto_20200606_1325.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | null | null | null | backend/apps/banking/migrations/0005_auto_20200606_1325.py | anilvrathod1/bestCDK | c940f27da8e0bcafb901f1f10adfb42308f49543 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-06 13:25
| 24.9 | 110 | 0.668675 | # Generated by Django 3.0.6 on 2020-06-06 13:25
import backend.storage_backends
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('banking', '0004_transaction_source_file'),
]
operations = [
migrations.AlterField(
model_name='s... | 0 | 0 | 0 | 352 | 0 | 0 | 0 | 29 | 68 |
ca077393cfe3d9b562b9a2aeb65df8b81d21219b | 642 | py | Python | project/payments/payment_methods/payments_stripe/views.py | steetstyle/Django-Ecommerce-API | 89c2c973e560346a5be74019709dc9a9f8ab7b2a | [
"MIT"
] | null | null | null | project/payments/payment_methods/payments_stripe/views.py | steetstyle/Django-Ecommerce-API | 89c2c973e560346a5be74019709dc9a9f8ab7b2a | [
"MIT"
] | null | null | null | project/payments/payment_methods/payments_stripe/views.py | steetstyle/Django-Ecommerce-API | 89c2c973e560346a5be74019709dc9a9f8ab7b2a | [
"MIT"
] | null | null | null |
# Create your views here. | 32.1 | 69 | 0.646417 | from django.http import JsonResponse
import stripe
# Create your views here.
def custom_webhook():
# Use an existing Customer ID if this is a returning customer
customer = stripe.Customer.create()
ephemeralKey = stripe.EphemeralKey.create(
customer=customer['id'],
stripe_version='2020-08-2... | 0 | 0 | 0 | 0 | 0 | 542 | 0 | 7 | 67 |
fa2f98208db00208b3176b879fdcf683b48c7520 | 1,106 | py | Python | cffi/build.py | chaichairiko/libyang-python | 46c2b1afc653c0b135c9fb70864314c38c909277 | [
"MIT"
] | null | null | null | cffi/build.py | chaichairiko/libyang-python | 46c2b1afc653c0b135c9fb70864314c38c909277 | [
"MIT"
] | null | null | null | cffi/build.py | chaichairiko/libyang-python | 46c2b1afc653c0b135c9fb70864314c38c909277 | [
"MIT"
] | null | null | null | # Copyright (c) 2018-2019 Robin Jarry
# SPDX-License-Identifier: MIT
import os
import shlex
import cffi
HERE = os.path.dirname(__file__)
BUILDER = cffi.FFI()
with open(os.path.join(HERE, "cdefs.h")) as f:
BUILDER.cdef(f.read())
HEADERS = search_paths("LIBYANG_HEADERS")
LIBRARIES = search_paths("LIBYANG_LIBR... | 23.531915 | 72 | 0.652803 | # Copyright (c) 2018-2019 Robin Jarry
# SPDX-License-Identifier: MIT
import os
import shlex
from typing import List
import cffi
HERE = os.path.dirname(__file__)
BUILDER = cffi.FFI()
with open(os.path.join(HERE, "cdefs.h")) as f:
BUILDER.cdef(f.read())
def search_paths(env_var: str) -> List[str]:
paths = ... | 0 | 0 | 0 | 0 | 0 | 180 | 0 | 2 | 45 |
e96677f83406870340bfdc9b9bd5499663417454 | 1,652 | py | Python | AWS/lambda/postEvent/lambda_function.py | jphacks/A_2104 | 60b623c4e90968deedd92e76a80db6e61fda2682 | [
"MIT"
] | 1 | 2021-10-31T06:20:37.000Z | 2021-10-31T06:20:37.000Z | AWS/lambda/postEvent/lambda_function.py | jphacks/A_2104 | 60b623c4e90968deedd92e76a80db6e61fda2682 | [
"MIT"
] | null | null | null | AWS/lambda/postEvent/lambda_function.py | jphacks/A_2104 | 60b623c4e90968deedd92e76a80db6e61fda2682 | [
"MIT"
] | null | null | null | import os
import datetime
def calc_transportation(body):
"""
return.
"""
margin = 5*60 #margin before next event start
ret = []
for i in range(len(body)):
indict = {}
if i==0:
dur = get_time(os.environ["HOME"],body[i]["location"],body[i]["mode"])
... | 25.415385 | 96 | 0.596852 | import os
import json
import urllib
import requests
import datetime
def get_time(origins,destinations,mode):
qs = {"origins":origins,"destinations":destinations,"mode":mode,"key":os.environ["API_KEY"]}
d_qs = urllib.parse.urlencode(qs)
url = os.environ["API_ENDPOINT"] + d_qs
payload={}
headers =... | 27 | 0 | 0 | 0 | 0 | 683 | 0 | -24 | 112 |
b7eb75c28aedca28c1d0a029af50f7a64f2e5cb6 | 944 | py | Python | examples/runMinimalExample.py | vmavrikopoulou/NetworkSimulator | fd31e7a8d25c7670b73b6fdfa37570fb28348b3f | [
"MIT"
] | null | null | null | examples/runMinimalExample.py | vmavrikopoulou/NetworkSimulator | fd31e7a8d25c7670b73b6fdfa37570fb28348b3f | [
"MIT"
] | null | null | null | examples/runMinimalExample.py | vmavrikopoulou/NetworkSimulator | fd31e7a8d25c7670b73b6fdfa37570fb28348b3f | [
"MIT"
] | null | null | null | # we need to import this in order to be able to import the simulator
# it does not have to do anything other than be imported.
from examples.minimalExample.SimulatorCrownstone import SimulatorCrownstone
from simulator import SimulationGui, JsonFileStore, Simulator
config = JsonFileStore('./minimalExample/config.json'... | 30.451613 | 88 | 0.772246 | # we need to import this in order to be able to import the simulator
# it does not have to do anything other than be imported.
from util import path
from examples.minimalExample.SimulatorCrownstone import SimulatorCrownstone
from simulator import SimulationGui, JsonFileStore, Simulator
config = JsonFileStore('./minim... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
e48b5c7f457f1d527389dccb56fae7187cb1b8dd | 711 | py | Python | dmriprep/workflows/dwi/conversions/nii_to_mif/utils.py | GalBenZvi/dmriprep | 7c4c0e1b01e3d941a7fafcbb6b001605cb1f2b0b | [
"Apache-2.0"
] | null | null | null | dmriprep/workflows/dwi/conversions/nii_to_mif/utils.py | GalBenZvi/dmriprep | 7c4c0e1b01e3d941a7fafcbb6b001605cb1f2b0b | [
"Apache-2.0"
] | 1 | 2022-03-22T13:22:18.000Z | 2022-03-22T13:22:18.000Z | dmriprep/workflows/dwi/conversions/nii_to_mif/utils.py | GalBenZvi/dmriprep | 7c4c0e1b01e3d941a7fafcbb6b001605cb1f2b0b | [
"Apache-2.0"
] | null | null | null | def locate_associated_files(in_file: str):
"""
Locates associated json (and possibly bvec & bval) files.
Parameters
----------
in_file : str
Input file.
Returns
-------
Tuple[str, str, str]
Tuple of associated json (and possibly bvec & bval) files.
"""
from dmri... | 27.346154 | 74 | 0.631505 | def locate_associated_files(in_file: str):
"""
Locates associated json (and possibly bvec & bval) files.
Parameters
----------
in_file : str
Input file.
Returns
-------
Tuple[str, str, str]
Tuple of associated json (and possibly bvec & bval) files.
"""
from dmri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3bca0bb330dfcde740470c11763d9116b9ce4302 | 280 | py | Python | Apostila_Bimestre_II/da_Apostila/primos_SEM_lista.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | Apostila_Bimestre_II/da_Apostila/primos_SEM_lista.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | Apostila_Bimestre_II/da_Apostila/primos_SEM_lista.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | n1 = int(input("Informe um nmero: "))
n2 = int(input("Informe um nmero maior que o anterior: "))
for x in range(n1, n2 + 1):
cont=0
for y in range(n1, x + 1):
if x%y==0:
cont+=1
if cont<=2:
print("{} ".format(y), end="") | 25.454545 | 59 | 0.482143 | n1 = int(input("Informe um número: "))
n2 = int(input("Informe um número maior que o anterior: "))
for x in range(n1, n2 + 1):
cont=0
for y in range(n1, x + 1):
if x%y==0:
cont+=1
if cont<=2:
print("{} ".format(y), end="") | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
98b61cbbc8ebb89f425e80f389f82538965ad923 | 5,146 | py | Python | tests/compiler/sample_input/titanic/titanic.py | ngpgn/contextual-ai | deb119395ced5242f243b2b31c074507e96646c0 | [
"Apache-2.0"
] | 83 | 2020-06-17T04:07:29.000Z | 2022-03-12T13:45:24.000Z | tests/compiler/sample_input/titanic/titanic.py | ngpgn/contextual-ai | deb119395ced5242f243b2b31c074507e96646c0 | [
"Apache-2.0"
] | 15 | 2020-06-30T09:22:19.000Z | 2021-11-11T10:52:40.000Z | tests/compiler/sample_input/titanic/titanic.py | ngpgn/contextual-ai | deb119395ced5242f243b2b31c074507e96646c0 | [
"Apache-2.0"
] | 11 | 2020-06-17T17:01:24.000Z | 2022-02-27T18:53:03.000Z | #Libraries
import pickle
# To ignore warnings
import warnings
import numpy as np
import pandas as pd
import re as re
from sklearn.tree import DecisionTreeClassifier
warnings.filterwarnings("ignore")
################################################################################
### Data Ingestion & Splitting
######... | 32.77707 | 139 | 0.547998 | #Libraries
import pickle
# To ignore warnings
import warnings
import numpy as np
import pandas as pd
import re as re
from sklearn.tree import DecisionTreeClassifier
warnings.filterwarnings("ignore")
################################################################################
### Data Ingestion & Splitting
######... | 0 | 0 | 0 | 0 | 0 | 125 | 0 | 0 | 22 |
3fd682ab39a18cddfb20ea63d3293a46a7c8e7e1 | 11,758 | py | Python | Example/Gutenkunst2007/von_Dassow_2000/spgNet.py | bcdaniels/SloppyCell | 17e68127a6aba19056a5067748a2d18241cc4d76 | [
"BSD-3-Clause"
] | 2 | 2020-05-26T19:29:39.000Z | 2020-08-26T20:54:52.000Z | Example/Gutenkunst2007/von_Dassow_2000/spgNet.py | bcdaniels/SloppyCell | 17e68127a6aba19056a5067748a2d18241cc4d76 | [
"BSD-3-Clause"
] | 1 | 2020-05-26T16:50:49.000Z | 2021-07-08T20:35:35.000Z | Example/Gutenkunst2007/von_Dassow_2000/spgNet.py | jurquiza/SloppyCellUrquiza2019 | a9f64d9d4172c82735813f09e48f36777a714e9c | [
"BSD-3-Clause"
] | 3 | 2017-09-12T03:12:01.000Z | 2018-10-19T11:08:09.000Z |
# This file was distributed with Ingenue
f = file('spg1_4cell.net')
lines = f.readlines()
for ii, line in enumerate(lines):
if line.startswith('&width'):
width = int(line.split()[1])
elif line.startswith('&height'):
height = int(line.split()[1])
elif line.startswith('&Network'):
n... | 41.111888 | 170 | 0.559024 | from SloppyCell.ReactionNetworks import *
# This file was distributed with Ingenue
f = file('spg1_4cell.net')
lines = f.readlines()
for ii, line in enumerate(lines):
if line.startswith('&width'):
width = int(line.split()[1])
elif line.startswith('&height'):
height = int(line.split()[1])
e... | 0 | 0 | 0 | 0 | 0 | 1,101 | 0 | 20 | 91 |
2d350f237cb6a15f4e2d76839103995ddf1d0c43 | 797 | py | Python | 25_read_write_text_files.py | nagasudhirpulla/python_wrldc_training | c3a3216c0a11e1dac03d4637b4b59b28f1bb83c6 | [
"MIT"
] | null | null | null | 25_read_write_text_files.py | nagasudhirpulla/python_wrldc_training | c3a3216c0a11e1dac03d4637b4b59b28f1bb83c6 | [
"MIT"
] | null | null | null | 25_read_write_text_files.py | nagasudhirpulla/python_wrldc_training | c3a3216c0a11e1dac03d4637b4b59b28f1bb83c6 | [
"MIT"
] | 2 | 2020-09-30T16:32:18.000Z | 2020-10-23T01:13:51.000Z | '''
read or write text files in python
'''
# %%
# read a text file
# open the file for reading
with open("dumps/test.txt", mode='r') as f:
# read all the file content
fStr = f.read()
# please note that once again calling f.read() will return empty string
print(fStr)
# this will print the whole fi... | 24.151515 | 74 | 0.647428 | '''
read or write text files in python
'''
# %%
# read a text file
# open the file for reading
with open("dumps/test.txt", mode='r') as f:
# read all the file content
fStr = f.read()
# please note that once again calling f.read() will return empty string
print(fStr)
# this will print the whole fi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
217ccd524a9351d8524155ddb70230b3fa79c06b | 1,963 | py | Python | server/algos/euler/tests/integration/test_setup.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 2 | 2017-11-27T21:55:21.000Z | 2017-12-30T03:34:40.000Z | server/algos/euler/tests/integration/test_setup.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 30 | 2017-09-06T12:00:08.000Z | 2018-06-20T22:47:46.000Z | server/algos/euler/tests/integration/test_setup.py | yizhang7210/Acre | c98cf8a4fdfb223a1958e8e61df759f889a1b13f | [
"MIT"
] | 1 | 2021-04-05T13:59:37.000Z | 2021-04-05T13:59:37.000Z | # pylint: disable=missing-docstring
| 32.180328 | 78 | 0.522669 | # pylint: disable=missing-docstring
import datetime
from core.models import instruments
from datasource.models import candles
class TestSetup():
@classmethod
def set_up_instruments(cls):
cls.eur_usd = instruments.Instrument(name='EUR_USD', multiplier=10000)
cls.eur_usd.save()
@classmetho... | 0 | 1,762 | 0 | -3 | 0 | 0 | 0 | 24 | 143 |
4496f05342c70d3584c3394094ffc8795187282b | 12,643 | py | Python | arknights_mower/solvers/recruit.py | YuiTH/arknights-mower | 01e65569ee13a470dde09911d2237331a8ed5b3d | [
"MIT"
] | null | null | null | arknights_mower/solvers/recruit.py | YuiTH/arknights-mower | 01e65569ee13a470dde09911d2237331a8ed5b3d | [
"MIT"
] | null | null | null | arknights_mower/solvers/recruit.py | YuiTH/arknights-mower | 01e65569ee13a470dde09911d2237331a8ed5b3d | [
"MIT"
] | null | null | null | from __future__ import annotations
| 38.663609 | 110 | 0.489678 | from __future__ import annotations
from ..ocr import ocrhandle, ocr_rectify
from ..utils import segment
from ..utils.device import Device
from ..utils.log import logger
from ..utils.recognize import Recognizer, Scene, RecognizeError
from ..utils.solver import BaseSolver
from ..data import recruit_tag, recruit_agent
... | 1,407 | 0 | 0 | 11,808 | 0 | 0 | 0 | 128 | 201 |
375bf56f2d70c880920c1c4d9ca81b57c85e9cb2 | 7,869 | py | Python | 03-cohort-analysis/01-plot-demographics.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | 03-cohort-analysis/01-plot-demographics.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | 03-cohort-analysis/01-plot-demographics.py | rionbr/DDIIndy | 63737cd05e92f496e7fa51fecc1c7542edba1f2e | [
"MIT"
] | null | null | null | # coding=utf-8
# Author: Rion B Correia
# Date: April 17, 2020
#
# Description: Demographics
#
#
import configparser
import numpy as np
import pandas as pd
import sqlalchemy
from sqlalchemy import event
from utils import add_own_encoders, ensurePathExists, map_age_to_age_group
import matplotlib as mpl
mpl.rcParams['mat... | 33.063025 | 183 | 0.574406 | # coding=utf-8
# Author: Rion B Correia
# Date: April 17, 2020
#
# Description: Demographics
#
#
import configparser
import numpy as np
import pandas as pd
import sqlalchemy
from sqlalchemy import event
from utils import add_own_encoders, ensurePathExists, map_age_to_age_group
import matplotlib as mpl
mpl.rcParams['mat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 22 |
c843c087d88d5065cf5a63507f064fd8b3d81707 | 5,139 | py | Python | bot/clients/stack_client.py | EJCFox/factorio-discord-bot | 150cb7f49a12edee781b2e57ebb2b5bddffcd851 | [
"MIT"
] | 1 | 2021-02-04T22:54:56.000Z | 2021-02-04T22:54:56.000Z | bot/clients/stack_client.py | EJCFox/factorio-discord-bot | 150cb7f49a12edee781b2e57ebb2b5bddffcd851 | [
"MIT"
] | 30 | 2021-12-17T20:33:06.000Z | 2022-01-02T14:35:31.000Z | bot/clients/stack_client.py | EJCFox/factorio-discord-bot | 150cb7f49a12edee781b2e57ebb2b5bddffcd851 | [
"MIT"
] | null | null | null | import aiobotocore
from ..helpers.env import getenv
BOT_IP = getenv('BOT_IP')
SSH_KEY_NAME = getenv('SSH_KEY_NAME')
_template = get_template()
_session = aiobotocore.get_session()
| 34.489933 | 85 | 0.505351 | import logging
import os
import aiobotocore
from ..helpers.env import getenv
BOT_IP = getenv('BOT_IP')
SSH_KEY_NAME = getenv('SSH_KEY_NAME')
def get_template():
with open(
os.path.join(os.path.dirname(
os.path.abspath(__file__)), '../template.yaml'),
encoding="utf8") as t... | 0 | 0 | 4,583 | 0 | 0 | 203 | 0 | -19 | 182 |
33a68569a46d9c6d65161ea6169a049677a6cc88 | 3,264 | py | Python | parallax/parallax/core/python/common/shard.py | snuspl/parallax | 83791254ccd5d7a55213687a8dff4c2e04372694 | [
"Apache-2.0"
] | 126 | 2018-07-26T07:06:56.000Z | 2022-01-25T08:11:25.000Z | parallal/parallax/core/python/common/shard.py | nikkkkhil/auto-parallal-deeplearning | 80e350fd933b8f82721bdc4950bc969ba0c630a4 | [
"Apache-2.0"
] | 20 | 2018-08-07T04:51:16.000Z | 2020-05-15T04:47:20.000Z | parallal/parallax/core/python/common/shard.py | nikkkkhil/auto-parallal-deeplearning | 80e350fd933b8f82721bdc4950bc969ba0c630a4 | [
"Apache-2.0"
] | 30 | 2018-08-01T13:25:43.000Z | 2022-02-28T01:28:34.000Z | # Copyright (C) 2018 Seoul National University
#
# 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 agre... | 37.090909 | 80 | 0.706189 | # Copyright (C) 2018 Seoul National University
#
# 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 agre... | 0 | 0 | 0 | 0 | 0 | 517 | 0 | 0 | 50 |
1a8e8be81848626887850c0eb27bf0b710e21586 | 2,185 | py | Python | video2images.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | null | null | null | video2images.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | null | null | null | video2images.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | null | null | null | """
@author: tenghehan
video image sequence .
"""
if __name__ == "__main__":
args = parse_args()
with VideoFramer(args, video_path=args.VIDEO_PATH) as vdo_frm:
vdo_frm.run() | 29.931507 | 97 | 0.642563 | """
@author: tenghehan
将 video 形式的视频数据转化成 image sequence 形式的数据.
"""
import cv2
import os
import argparse
from tqdm import tqdm
from utils.log import get_logger
class VideoFramer(object):
def __init__(self, args, video_path):
self.args = args
self.video_path = video_path
self.logger = get_... | 48 | 0 | 0 | 1,579 | 0 | 257 | 0 | -18 | 157 |
0c8bec83e7b2a1f70caa96c61d46a9eeb3799d06 | 2,731 | py | Python | examples/tag_by_location.py | Trinity-College/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 27 | 2015-04-21T09:01:56.000Z | 2021-08-21T22:39:12.000Z | examples/tag_by_location.py | Trinity-College/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2015-04-16T05:57:18.000Z | 2017-05-03T18:34:16.000Z | examples/tag_by_location.py | davids-uta-edu/py-space-platform | 2ead02c1af8b696cf673eddaac5199c8267f0bf3 | [
"ECL-2.0",
"Apache-2.0"
] | 22 | 2015-03-26T08:41:04.000Z | 2020-09-24T19:50:43.000Z | """
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
Copyright (c) 2015 Juniper Networks, Inc.
All rights reserved.
Use is subject to license terms.
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 th... | 36.413333 | 82 | 0.693885 | """
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
Copyright (c) 2015 Juniper Networks, Inc.
All rights reserved.
Use is subject to license terms.
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 th... | 0 | 0 | 0 | 0 | 0 | 644 | 0 | 9 | 23 |
ed45d468f0c2248b8d88b97319d7a1360e54055b | 7,743 | py | Python | fluidfoam/processing1d.py | remichassagne/fluidfoam | fa89f4cdd2f159619ed7d128257612e183926c93 | [
"CECILL-B"
] | 64 | 2018-03-08T21:52:48.000Z | 2022-03-31T08:11:17.000Z | fluidfoam/processing1d.py | CyrilleBonamy/fluidfoam | 2befa35722aa7aa13ac7d48884461614d608262b | [
"CECILL-B"
] | 14 | 2019-12-12T10:56:10.000Z | 2022-03-31T15:32:47.000Z | fluidfoam/processing1d.py | CyrilleBonamy/fluidfoam | 2befa35722aa7aa13ac7d48884461614d608262b | [
"CECILL-B"
] | 21 | 2019-09-25T21:34:43.000Z | 2022-03-31T14:49:12.000Z | """Write, Read and Plot 1D input files for swak4foam
==========================================================================
This module allows to read OpenFoam output of one dimensional computation
and then write, plot and read input files for Boundary and Initial
Conditions imposition in 3D computation (via swak4f... | 32.39749 | 114 | 0.496965 | """Write, Read and Plot 1D input files for swak4foam
==========================================================================
This module allows to read OpenFoam output of one dimensional computation
and then write, plot and read input files for Boundary and Initial
Conditions imposition in 3D computation (via swak4f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
963b388baf2e86c3adb9df71da6250a85efe136a | 2,765 | py | Python | energy_usage/main.py | optiz0r/energy-usage | b7b57fb05e46257af96db287ed9eff63cb4c5677 | [
"MIT"
] | 6 | 2020-10-12T22:18:55.000Z | 2021-06-13T09:36:49.000Z | energy_usage/main.py | optiz0r/energy-usage | b7b57fb05e46257af96db287ed9eff63cb4c5677 | [
"MIT"
] | 1 | 2021-06-13T09:56:10.000Z | 2021-06-13T20:16:04.000Z | energy_usage/main.py | optiz0r/energy-usage | b7b57fb05e46257af96db287ed9eff63cb4c5677 | [
"MIT"
] | 1 | 2021-05-09T14:20:59.000Z | 2021-05-09T14:20:59.000Z |
if __name__ == '__main__':
main()
| 25.136364 | 103 | 0.625316 | import argparse
import logging
import os
import queue
import sys
import confuse
from energy_usage.influx_client import InfluxClient
from energy_usage.mqtt_client import MqttClient
from energy_usage.sep import parse_sep, usage_to_datapoints
def parse_args(arg_str=None):
if arg_str is None:
arg_str = sys.... | 0 | 0 | 0 | 0 | 0 | 2,363 | 0 | 42 | 315 |
68447a9b071c1a187cc068eb308d7b403243d6b0 | 6,812 | py | Python | autogl/module/model/encoders/_dgl/_gin.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | autogl/module/model/encoders/_dgl/_gin.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | autogl/module/model/encoders/_dgl/_gin.py | dedsec-9/AutoGL | 487f2b2f798b9b1363ad5dc100fb410b12222e06 | [
"MIT"
] | null | null | null | from .. import base_encoder, encoder_registry
from ... import _utils
| 34.933333 | 98 | 0.546829 | import dgl
import torch.nn.functional
import typing as _typing
from dgl.nn.pytorch.conv import GINConv
from .. import base_encoder, encoder_registry
from ... import _utils
class ApplyNodeFunc(torch.nn.Module):
"""Update the node feature hv with MLP, BN and ReLU."""
def __init__(self, mlp):
super(Apply... | 0 | 2,753 | 0 | 3,791 | 0 | 0 | 0 | 15 | 180 |
eb1669f961f86b086e499126d0d7b3bd559ac0d8 | 26,338 | py | Python | infotrope/datasets/base.py | dwd/Polymer | 656d2b2f159b649fdb5281b82d938fb5453b9047 | [
"MIT"
] | 4 | 2016-04-14T06:52:02.000Z | 2019-03-30T08:43:14.000Z | infotrope/datasets/base.py | dwd/Polymer | 656d2b2f159b649fdb5281b82d938fb5453b9047 | [
"MIT"
] | null | null | null | infotrope/datasets/base.py | dwd/Polymer | 656d2b2f159b649fdb5281b82d938fb5453b9047 | [
"MIT"
] | null | null | null | #
# Copyright 2004,2005 Dave Cridland <dave@cridland.net>
#
# This file forms part of the Infotrope Python Library.
#
# The Infotrope Python Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either versi... | 36.030096 | 298 | 0.539601 | #
# Copyright 2004,2005 Dave Cridland <dave@cridland.net>
#
# This file forms part of the Infotrope Python Library.
#
# The Infotrope Python Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either versi... | 0 | 0 | 0 | 24,276 | 0 | 787 | 0 | 0 | 298 |
e39cc9e52f76f774f895e55eda47eb10730e2507 | 2,325 | py | Python | examples/publications/b_ATB_solvationFreeEnergies/sets/build_gromos_singleligand_files.py | SalomeRonja/restraintmaker | ecb4c524cb11ffffa2ee3a3665056412bef84999 | [
"MIT"
] | 1 | 2021-11-15T14:01:28.000Z | 2021-11-15T14:01:28.000Z | examples/publications/b_ATB_solvationFreeEnergies/sets/build_gromos_singleligand_files.py | SalomeRonja/restraintmaker | ecb4c524cb11ffffa2ee3a3665056412bef84999 | [
"MIT"
] | 3 | 2021-10-01T18:35:59.000Z | 2022-01-28T14:59:34.000Z | examples/publications/b_ATB_solvationFreeEnergies/sets/build_gromos_singleligand_files.py | SalomeRonja/restraintmaker | ecb4c524cb11ffffa2ee3a3665056412bef84999 | [
"MIT"
] | 3 | 2020-12-27T12:27:15.000Z | 2021-11-01T13:45:14.000Z | #%%
import os, sys, glob
from pygromos.gromos.gromosPP import GromosPP
import restraintmaker
#CHANGE HERE
gromos_bin_path = "/home/bschroed/Documents/code/gromosPP/installed/bin"
restraintmaker_path = os.path.abspath(os.path.dirname(restraintmaker.__file__)+"/..")
control_dict = {
"gen_resn_lib": False,
"gen... | 33.695652 | 142 | 0.732903 | #%%
import os, sys, glob
from collections import defaultdict
from pygromos.gromos.gromosPP import GromosPP
from pygromos.gromos.gromosXX import GromosXX
from pygromos.files import imd
import restraintmaker
#CHANGE HERE
gromos_bin_path = "/home/bschroed/Documents/code/gromosPP/installed/bin"
restraintmaker_path = os.p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 66 |
7c4114e3fdb667259e1827035838bb4fd2294646 | 1,228 | py | Python | examples/graph/football.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | null | null | null | examples/graph/football.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | null | null | null | examples/graph/football.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | 2 | 2016-09-04T10:59:12.000Z | 2020-02-17T07:43:04.000Z | #!/usr/bin/env python
"""
Load football network in GML format and compute some network statistcs.
Shows how to download GML graph in a zipped file, unpack it, and load
into a NetworkX graph.
Requires Internet connection to download the URL
http://www-personal.umich.edu/~mejn/netdata/football.zip
"""
# Author: Aric H... | 26.12766 | 71 | 0.708469 | #!/usr/bin/env python
"""
Load football network in GML format and compute some network statistcs.
Shows how to download GML graph in a zipped file, unpack it, and load
into a NetworkX graph.
Requires Internet connection to download the URL
http://www-personal.umich.edu/~mejn/netdata/football.zip
"""
# Author: Aric H... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 23 |
ab45ba28ece2b6f08898955e44b4f746e4747d64 | 2,390 | py | Python | locations/spiders/goodwill.py | davidchiles/alltheplaces | 6f35f6cd652e7462107ead0a77f322caff198653 | [
"MIT"
] | 297 | 2017-12-07T01:29:14.000Z | 2022-03-29T06:58:01.000Z | locations/spiders/goodwill.py | davidchiles/alltheplaces | 6f35f6cd652e7462107ead0a77f322caff198653 | [
"MIT"
] | 2,770 | 2017-11-28T04:20:21.000Z | 2022-03-31T11:29:16.000Z | locations/spiders/goodwill.py | davidchiles/alltheplaces | 6f35f6cd652e7462107ead0a77f322caff198653 | [
"MIT"
] | 111 | 2017-11-27T21:40:02.000Z | 2022-01-22T01:21:52.000Z | # -*- coding: utf-8 -*-
CATEGORY_MAPPING = {
'1': 'Donation Site',
'2': 'Outlet',
'3': 'Retail Store',
'4': 'Job & Career Support',
'5': 'Headquarters'
}
| 33.661972 | 106 | 0.516736 | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
CATEGORY_MAPPING = {
'1': 'Donation Site',
'2': 'Outlet',
'3': 'Retail Store',
'4': 'Job & Career Support',
'5': 'Headquarters'
}
class GoodwillSpider(scrapy.Spider):
name = "goodwill"
item_attr... | 0 | 0 | 0 | 2,120 | 0 | 0 | 0 | 5 | 89 |
2ea619d0142a49aa8f384ca7d65a3b1adde4ebbc | 2,170 | py | Python | apps/core/manager.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | apps/core/manager.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | apps/core/manager.py | zjjott/html | 68429832d8b022602915a267a62051f4869f430f | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import unicode_literals
managers = [ShellManage, DBShellManage, # flake8: noqa
RedisManage,
]
| 26.790123 | 69 | 0.621659 | # coding=utf-8
from __future__ import unicode_literals
import sys
from IPython import start_ipython
import argparse
from apps.core.models.client import Client
import apps.conf # flake8: noqa
from tornado.options import options
import subprocess
class BaseManage(object):
name = None # 启动子命令
doc = "" # 会用这个属... | 153 | 0 | 0 | 1,680 | 0 | 0 | 0 | 21 | 262 |
44878be67aae6a9ac74d9c0d731b8c221c71e809 | 2,329 | py | Python | src/tools/visum-transformer/read_infrastructure/src/read_infrastructure/util/lines.py | railtoolkit/OpenLinTim | 27eba8b6038946ce162e9f7bbc0bd23045029d51 | [
"MIT"
] | null | null | null | src/tools/visum-transformer/read_infrastructure/src/read_infrastructure/util/lines.py | railtoolkit/OpenLinTim | 27eba8b6038946ce162e9f7bbc0bd23045029d51 | [
"MIT"
] | null | null | null | src/tools/visum-transformer/read_infrastructure/src/read_infrastructure/util/lines.py | railtoolkit/OpenLinTim | 27eba8b6038946ce162e9f7bbc0bd23045029d51 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 48.520833 | 124 | 0.719193 | import logging
from core.model.graph import Graph
from core.model.lines import LinePool, Line
from core.model.ptn import Link, Stop
from common.model.net import Net
from common.util.constants import LINE_SECTION_HEADER, LINE_ROUTE_ITEMS_SECTION_HEADER, \
LINE_ROUTE_ITEMS_DIRECTION_HEADER, LINE_ROUTE_ITEMS_LINE_NAM... | 0 | 0 | 0 | 0 | 0 | 1,886 | 0 | 233 | 157 |
bacc25571619ca1a153b7a8436183e857481c80b | 1,334 | py | Python | venv/Lib/site-packages/mcipc/rcon/je/commands/teleport.py | Svesnav2/Discord-Bot-Minecraft-server-status | ee34948e741930567a3adb557197523f9d32ace1 | [
"Unlicense"
] | null | null | null | venv/Lib/site-packages/mcipc/rcon/je/commands/teleport.py | Svesnav2/Discord-Bot-Minecraft-server-status | ee34948e741930567a3adb557197523f9d32ace1 | [
"Unlicense"
] | null | null | null | venv/Lib/site-packages/mcipc/rcon/je/commands/teleport.py | Svesnav2/Discord-Bot-Minecraft-server-status | ee34948e741930567a3adb557197523f9d32ace1 | [
"Unlicense"
] | null | null | null | """Implementation of the teleport command."""
from mcipc.rcon.client import Client
from mcipc.rcon.types import Anchor, Rotation, Vec3
__all__ = ['teleport']
def teleport(self: Client, *, destination: str = None, location: Vec3 = None,
targets: str = None, rotation: Rotation = None,
facin... | 31.761905 | 77 | 0.621439 | """Implementation of the teleport command."""
from mcipc.rcon.client import Client
from mcipc.rcon.types import Anchor, Rotation, Vec3
__all__ = ['teleport']
def teleport(self: Client, *, destination: str = None, location: Vec3 = None,
targets: str = None, rotation: Rotation = None,
facin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
36dd5b81f7f62cd69ec877d923d43b280523fb8d | 4,046 | py | Python | scripts/function_puller.py | alcuadrado/eth2.0-specs | f55499c0baad5d22a6f7749a9153374c7edf9267 | [
"CC0-1.0"
] | null | null | null | scripts/function_puller.py | alcuadrado/eth2.0-specs | f55499c0baad5d22a6f7749a9153374c7edf9267 | [
"CC0-1.0"
] | null | null | null | scripts/function_puller.py | alcuadrado/eth2.0-specs | f55499c0baad5d22a6f7749a9153374c7edf9267 | [
"CC0-1.0"
] | null | null | null | import re
from typing import Dict, Tuple, NewType
FUNCTION_REGEX = r'^def [\w_]*'
BEGIN_INSERT_REGEX = r'# begin insert '
END_INSERT_REGEX = r'# end insert'
SpecObject = NewType('SpecObjects', Tuple[Dict[str, str], Dict[str, str], Dict[str, str], Dict[str, str]])
def get_spec(file_name: str) -> SpecObject:
"""... | 45.460674 | 119 | 0.542511 | import re
from typing import Dict, Tuple, NewType
FUNCTION_REGEX = r'^def [\w_]*'
BEGIN_INSERT_REGEX = r'# begin insert '
END_INSERT_REGEX = r'# end insert'
SpecObject = NewType('SpecObjects', Tuple[Dict[str, str], Dict[str, str], Dict[str, str], Dict[str, str]])
def get_spec(file_name: str) -> SpecObject:
"""... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d8bf094e28fe8390c3d84fdfd1c20be429c49d9e | 98 | py | Python | enthought/envisage/ui/action/action_set.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/envisage/ui/action/action_set.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/envisage/ui/action/action_set.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
| 24.5 | 43 | 0.836735 | # proxy module
from __future__ import absolute_import
from envisage.ui.action.action_set import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 22 |
6a1c23894572a4e4e41bf47b5f43b2d3243c094a | 521 | py | Python | MainFiles/pythion/Assignment1_1_answer.py | Morris-wambua/pyKid | 99765ee9ee337efc2ba1f4be4007f34df0e6a8f1 | [
"MIT"
] | null | null | null | MainFiles/pythion/Assignment1_1_answer.py | Morris-wambua/pyKid | 99765ee9ee337efc2ba1f4be4007f34df0e6a8f1 | [
"MIT"
] | null | null | null | MainFiles/pythion/Assignment1_1_answer.py | Morris-wambua/pyKid | 99765ee9ee337efc2ba1f4be4007f34df0e6a8f1 | [
"MIT"
] | null | null | null | for i in range(1,26):
print('{0:5d}{1:5d}{2:6d}{3:6d}{4:6d}{5:6d}{6:6d}{7:6d}'.format(i,i*i,i+25,(i+25)*(i+25),i+50,(i+50)*(i+50),i+75,(i+75)*(i+75)))
# the characters in the curly brackets {} are placeholders for the data.
# the character before the colon indicates which of the data pieces should go where.
# the ... | 65.125 | 132 | 0.708253 | for i in range(1,26):
print('{0:5d}{1:5d}{2:6d}{3:6d}{4:6d}{5:6d}{6:6d}{7:6d}'.format(i,i*i,i+25,(i+25)*(i+25),i+50,(i+50)*(i+50),i+75,(i+75)*(i+75)))
# the characters in the curly brackets {} are placeholders for the data.
# the character before the colon indicates which of the data pieces should go where.
# the ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
60759756c71a6da5c53813749d3da3fe55759688 | 3,105 | py | Python | utils_mod.py | innovator-zero/CS410_AI_Project2 | 2d33eb43274dcf6875f48b656ab7c7504ad2f7fa | [
"MIT"
] | null | null | null | utils_mod.py | innovator-zero/CS410_AI_Project2 | 2d33eb43274dcf6875f48b656ab7c7504ad2f7fa | [
"MIT"
] | null | null | null | utils_mod.py | innovator-zero/CS410_AI_Project2 | 2d33eb43274dcf6875f48b656ab7c7504ad2f7fa | [
"MIT"
] | null | null | null |
# MAP
# restrict on @K is in ap_at_n
# data load generator
| 31.363636 | 111 | 0.571014 | import numpy as np
from multiprocessing import Pool
import glob
import os
import pandas as pd
import tensorflow as tf
def ap_at_10(data):
# based on https://github.com/google/youtube-8m/blob/master/average_precision_calculator.py
predictions, actuals = data
n = 10
total_num_positives = None
if le... | 0 | 0 | 0 | 0 | 1,591 | 1,242 | 0 | -14 | 222 |
d9bd8a4e9880845e45b6e63860e014baf705d1c0 | 76 | py | Python | hucrl/agent/__init__.py | lioritan/hucrl | fb5b3aea0edf69a4169ab79d2908918111fc6072 | [
"MIT"
] | 24 | 2020-12-05T20:10:27.000Z | 2022-03-25T10:00:51.000Z | hucrl/agent/__init__.py | lioritan/hucrl | fb5b3aea0edf69a4169ab79d2908918111fc6072 | [
"MIT"
] | 3 | 2021-02-04T10:07:30.000Z | 2021-06-02T15:25:18.000Z | hucrl/agent/__init__.py | lioritan/hucrl | fb5b3aea0edf69a4169ab79d2908918111fc6072 | [
"MIT"
] | 4 | 2021-04-04T12:36:40.000Z | 2022-03-26T10:37:55.000Z | """Python Script Template."""
| 25.333333 | 45 | 0.776316 | """Python Script Template."""
from .model_based import MBMPOAgent, MPCAgent
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 22 |
773f2dc30158c6d31ef821abf78ea88a059a38bd | 5,973 | py | Python | scripts/db_to_bundle.py | adolgert/cascade | 2084e07c9ee5e901dd407b817220de882c7246a3 | [
"MIT"
] | null | null | null | scripts/db_to_bundle.py | adolgert/cascade | 2084e07c9ee5e901dd407b817220de882c7246a3 | [
"MIT"
] | null | null | null | scripts/db_to_bundle.py | adolgert/cascade | 2084e07c9ee5e901dd407b817220de882c7246a3 | [
"MIT"
] | null | null | null |
MEASURES_ACCEPTABLE_TO_ELMO = {
"prevalence",
"duration",
"yld",
"continuous",
"cfr",
"proportion",
"mtstandard",
"relrisk",
"incidence",
"tincidence",
"sincidence",
"remission",
"mtexcess",
"pmtexcess",
"mtwith",
"mtall",
"mtspecific",
"mtother",... | 26.312775 | 110 | 0.61845 | import argparse
import os
import re
from pathlib import Path
import numpy as np
import pandas as pd
from cascade.dismod.constants import DensityEnum, IntegrandEnum
from cascade.dismod.db.wrapper import get_engine
from cascade.input_data.configuration.id_map import make_integrand_map
MEASURES_ACCEPTABLE_TO_ELMO = {
... | 0 | 0 | 0 | 0 | 0 | 3,382 | 0 | 86 | 223 |
756c5c44c633b5ed7e03288193e68c4de5dc6001 | 169 | py | Python | src/llana_main.py | carchard/llana | 8f755ad4e0217f67ececb639b4cf2b32294496ce | [
"MIT"
] | null | null | null | src/llana_main.py | carchard/llana | 8f755ad4e0217f67ececb639b4cf2b32294496ce | [
"MIT"
] | null | null | null | src/llana_main.py | carchard/llana | 8f755ad4e0217f67ececb639b4cf2b32294496ce | [
"MIT"
] | null | null | null | # authors:
# connor archard
# geoff keating
#
# updated:
# 12-15-2016
#
# brief:
# main file for llana operation
if __name__ == "__main__":
print "Hello world" | 13 | 32 | 0.650888 | # authors:
# connor archard
# geoff keating
#
# updated:
# 12-15-2016
#
# brief:
# main file for llana operation
if __name__ == "__main__":
print "Hello world" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
861e85ffcb8b0f165a295f1b2f939988161d235d | 1,598 | py | Python | transform.py | oskar-j/walsh-hadamard-transform | cd7df03648225e08ac6736194d7d605aaf49626b | [
"MIT"
] | 5 | 2019-07-01T21:26:22.000Z | 2021-08-22T01:51:52.000Z | transform.py | oskar-j/walsh-hadamard-transform | cd7df03648225e08ac6736194d7d605aaf49626b | [
"MIT"
] | 1 | 2019-07-07T14:33:24.000Z | 2019-07-07T14:33:24.000Z | transform.py | oskar-j/walsh-hadamard-transform | cd7df03648225e08ac6736194d7d605aaf49626b | [
"MIT"
] | null | null | null | # coding: utf-8
from fal.task import Task
import numpy as np
from PIL import Image
from matplotlib.pyplot import imshow
from matplotlib.pyplot import hist
import matplotlib.pyplot as plt
if __name__ == '__main__':
# Let'c create compression task
task = Task()
# We define in 'data flow' that we wish t... | 26.196721 | 90 | 0.695244 | # coding: utf-8
from fal.task import Task
import numpy as np
from PIL import Image
from matplotlib.pyplot import imshow
from matplotlib.pyplot import hist
import matplotlib.pyplot as plt
if __name__ == '__main__':
# Let'c create compression task
task = Task()
# We define in 'data flow' that we wish t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
969d383d8ad8e247a4bde60f2e4ef30b26b6f0ea | 5,763 | py | Python | clinicadl/clinicadl/tools/deep_learning/models/slice_level.py | CCF0211/AD-DL | f449db4b8370d0d31fd2c815def2e175bfd29cb9 | [
"MIT"
] | null | null | null | clinicadl/clinicadl/tools/deep_learning/models/slice_level.py | CCF0211/AD-DL | f449db4b8370d0d31fd2c815def2e175bfd29cb9 | [
"MIT"
] | null | null | null | clinicadl/clinicadl/tools/deep_learning/models/slice_level.py | CCF0211/AD-DL | f449db4b8370d0d31fd2c815def2e175bfd29cb9 | [
"MIT"
] | null | null | null | # coding: utf8
import torch.utils.model_zoo as model_zoo
from torchvision.models.resnet import BasicBlock
from torch import nn
__all__ = ['resnet18_2d', 'vit']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth'
}
def resnet18_2d(**kwargs):
"""
Construct a the Res... | 33.9 | 104 | 0.618601 | # coding: utf8
import torch.utils.model_zoo as model_zoo
from torchvision.models.resnet import BasicBlock
from torch import nn
import math
import timm
import urllib
from PIL import Image
from timm.data import resolve_data_config
from timm.data.transforms_factory import create_transform
import torch.nn.functional as F
... | 0 | 0 | 0 | 3,290 | 0 | 842 | 0 | 38 | 269 |
7dd3626fa9166bf1afb27b484c0c537345831354 | 12,541 | py | Python | tools/data_builder.py | cmenedes/police-brutality | a978046291015716a4972b478a01fe192f5f5ea1 | [
"MIT"
] | 1 | 2020-09-30T18:43:31.000Z | 2020-09-30T18:43:31.000Z | tools/data_builder.py | cmenedes/police-brutality | a978046291015716a4972b478a01fe192f5f5ea1 | [
"MIT"
] | null | null | null | tools/data_builder.py | cmenedes/police-brutality | a978046291015716a4972b478a01fe192f5f5ea1 | [
"MIT"
] | null | null | null | import os
import re
from datetime import datetime, timezone
# `or '.'` because when you're in the same directory as this code
# `ValueError: no path specified` gets thrown by `relpath` with empty input
src_dir = os.path.relpath(os.path.dirname(__file__) or ".")
possible_tags_path = os.path.join(src_dir, "..", "docs/po... | 32.15641 | 255 | 0.600989 | import csv
import glob
import json
import os
import re
import copy
from dateutil.parser import parse
from datetime import datetime, timezone
# `or '.'` because when you're in the same directory as this code
# `ValueError: no path specified` gets thrown by `relpath` with empty input
src_dir = os.path.relpath(os.path.d... | 0 | 0 | 0 | 0 | 3,472 | 4,166 | 0 | -29 | 479 |
597a0880ab1292080a540b2aee82937627ce1567 | 2,007 | py | Python | server/edd/urls.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 13 | 2016-11-15T07:33:40.000Z | 2021-09-22T12:19:13.000Z | server/edd/urls.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 40 | 2017-04-04T15:20:14.000Z | 2022-03-31T04:34:37.000Z | server/edd/urls.py | trussworks/edd | 1183c6bb1f04de31d8c4c6ed7b97b051228f3bb7 | [
"BSD-3-Clause-LBNL"
] | 10 | 2017-09-21T07:27:01.000Z | 2022-03-10T17:02:19.000Z | from django.conf import settings
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.contrib.flatpages import views as flatpage_views
from django.http import HttpResponse
from django.urls import include, path, re_path
from edd.branding.views import favicon as favicon_... | 37.867925 | 86 | 0.694071 | from django.conf import settings
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.contrib.flatpages import views as flatpage_views
from django.http import HttpResponse
from django.urls import include, path, re_path
from edd.branding.views import favicon as favicon_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a6166bacafb2941014a2080438fc330df92d394d | 1,387 | py | Python | venv/Lib/site-packages/prompt_toolkit/output/color_depth.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | venv/Lib/site-packages/prompt_toolkit/output/color_depth.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | venv/Lib/site-packages/prompt_toolkit/output/color_depth.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z |
__all__ = [
"ColorDepth",
]
| 23.508475 | 77 | 0.64672 | import os
from enum import Enum
from typing import Optional
__all__ = [
"ColorDepth",
]
class ColorDepth(str, Enum):
"""
Possible color depth values for the output.
"""
value: str
#: One color only.
DEPTH_1_BIT = "DEPTH_1_BIT"
#: ANSI Colors.
DEPTH_4_BIT = "DEPTH_4_BIT"
#:... | 0 | 770 | 0 | 500 | 0 | 0 | 0 | -6 | 89 |
63208333abce488e6b6180083bdb0989bfa6ab67 | 2,771 | py | Python | spectratmo/util.py | tabataba/spectratmo-puma | 3cd9e07df012b5a7a3f298c68f8607c225b6f6a8 | [
"CECILL-B"
] | 1 | 2020-02-12T23:05:19.000Z | 2020-02-12T23:05:19.000Z | spectratmo/util.py | tabataba/spectratmo-puma | 3cd9e07df012b5a7a3f298c68f8607c225b6f6a8 | [
"CECILL-B"
] | null | null | null | spectratmo/util.py | tabataba/spectratmo-puma | 3cd9e07df012b5a7a3f298c68f8607c225b6f6a8 | [
"CECILL-B"
] | 1 | 2020-02-12T23:05:35.000Z | 2020-02-12T23:05:35.000Z | """Utilities
============
.. autoclass:: SetOfVariables
:members:
:private-members:
.. autoclass:: SetOfSpectra
:members:
:private-members:
.. autoclass:: StackOfSetOfVariables
:members:
:private-members:
"""
| 28.56701 | 68 | 0.595453 | """Utilities
============
.. autoclass:: SetOfVariables
:members:
:private-members:
.. autoclass:: SetOfSpectra
:members:
:private-members:
.. autoclass:: StackOfSetOfVariables
:members:
:private-members:
"""
import numpy as np
from spectratmo.phys_const import g, Gamma_dah
class SetOfVariable... | 0 | 0 | 0 | 2,397 | 0 | 0 | 0 | 22 | 115 |
8467b955db47e5c9760d26d8fee35028c732a1da | 11,009 | py | Python | bot.py | EndorFinee/PCBot | 08f6f3e2befe5e15c5f874492d1085b5efcc828c | [
"MIT"
] | null | null | null | bot.py | EndorFinee/PCBot | 08f6f3e2befe5e15c5f874492d1085b5efcc828c | [
"MIT"
] | null | null | null | bot.py | EndorFinee/PCBot | 08f6f3e2befe5e15c5f874492d1085b5efcc828c | [
"MIT"
] | 1 | 2019-07-07T14:21:02.000Z | 2019-07-07T14:21:02.000Z | # -*- coding: utf-8 -*-
import os
import telebot
import psycopg2
from telebot import types
# Config vars
token = os.environ['TELEGRAM_TOKEN']
DATABASE_URL=os.environ['DATABASE_URL']
connect = psycopg2.connect(DATABASE_URL, sslmode='require')
cursor = connect.cursor()
#some_api_token = os.environ['SOME_API_TOK... | 65.922156 | 161 | 0.619039 | # -*- coding: utf-8 -*-
import os
import telebot
import config
import random
import sys
import time
import psycopg2
from telebot import types
# Config vars
token = os.environ['TELEGRAM_TOKEN']
DATABASE_URL=os.environ['DATABASE_URL']
connect = psycopg2.connect(DATABASE_URL, sslmode='require')
cursor = connect.... | 598 | 10,045 | 0 | 0 | 0 | 0 | 0 | -37 | 154 |
cc897b11910cd602b094ea8e7f9823468db50c02 | 16,297 | py | Python | vase/vep_filter.py | david-a-parry/vase | 698c19eb1d92b56248ad0a1d32be3e4f21137cf5 | [
"MIT"
] | 4 | 2020-03-25T06:09:39.000Z | 2021-03-23T11:22:00.000Z | vase/vep_filter.py | gantzgraf/vase | 52eb6a514fd89e7c4e290c258fdbbc1636db6168 | [
"MIT"
] | 1 | 2020-10-02T14:50:30.000Z | 2020-10-12T15:24:24.000Z | vase/vep_filter.py | gantzgraf/vase | 52eb6a514fd89e7c4e290c258fdbbc1636db6168 | [
"MIT"
] | 1 | 2021-02-20T11:32:34.000Z | 2021-02-20T11:32:34.000Z |
lof_csq = {'frameshift_variant', 'stop_gained', 'splice_acceptor_variant',
'splice_donor_variant'}
| 44.285326 | 79 | 0.517519 | import os
import logging
from .insilico_filter import InSilicoFilter
from .csq_filter import CsqFilter
lof_csq = {'frameshift_variant', 'stop_gained', 'splice_acceptor_variant',
'splice_donor_variant'}
class VepFilter(CsqFilter):
'''An object that filters VCF records based on annotated VEP data.'''
... | 0 | 0 | 0 | 16,059 | 0 | 0 | 0 | 15 | 111 |
93ea7ae18c0399f765785f8b3f05735d7bd8fccf | 236 | py | Python | test/scenarios/command_check/tests/test_default.py | gzm55/molecule | 1d6ff8fe861fb5657c6f28c2f5918cce4f25adce | [
"MIT"
] | 1 | 2019-02-02T21:47:19.000Z | 2019-02-02T21:47:19.000Z | test/scenarios/command_check/tests/test_default.py | DalavanCloud/molecule | 86e497c1f81a99df4e1d357c417a6d315e903db2 | [
"MIT"
] | 2 | 2021-03-25T23:55:15.000Z | 2022-03-29T22:01:50.000Z | test/scenarios/command_check/tests/test_default.py | DalavanCloud/molecule | 86e497c1f81a99df4e1d357c417a6d315e903db2 | [
"MIT"
] | 1 | 2019-02-02T21:46:56.000Z | 2019-02-02T21:46:56.000Z | import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/ansible_inventory').get_hosts('all')
| 21.454545 | 63 | 0.754237 | import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/ansible_inventory').get_hosts('all')
def test_hosts_file(File):
f = File('/tmp/check')
assert not f.exists
| 0 | 0 | 0 | 0 | 0 | 57 | 0 | 0 | 23 |
824803f06491ef81f75eb0d5b0132969f56c12cf | 6,808 | py | Python | progressivis/stats/blobs_table.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 51 | 2015-09-14T16:31:02.000Z | 2022-01-12T17:56:53.000Z | progressivis/stats/blobs_table.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 10 | 2017-11-15T15:10:05.000Z | 2022-01-19T07:36:43.000Z | progressivis/stats/blobs_table.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 5 | 2017-11-14T20:20:56.000Z | 2020-01-22T06:26:51.000Z | """
Isotropic Gaussian blobs
"""
import logging
from ..utils.errors import ProgressiveError
logger = logging.getLogger(__name__)
RESERVOIR_SIZE = 10000
| 36.021164 | 111 | 0.606345 | """
Isotropic Gaussian blobs
"""
from collections import OrderedDict
import logging
import numpy as np
from abc import ABCMeta, abstractmethod
from ..utils.errors import ProgressiveError, ProgressiveStopIteration
from progressivis import ProgressiveError, SlotDescriptor
from ..table.module import TableModule
from ..t... | 0 | 37 | 0 | 5,336 | 0 | 707 | 0 | 210 | 359 |
79e89d3d683da0d16d985f1e6446742d0dfd7fc1 | 950 | py | Python | SRT/lib/datasets/optflow_utils.py | yerang823/landmark-detection | a01bcf79abcf9d203c1b92f29b49aab9005952c3 | [
"MIT"
] | 612 | 2019-06-01T07:10:57.000Z | 2022-03-30T13:44:41.000Z | SRT/lib/datasets/optflow_utils.py | yerang823/landmark-detection | a01bcf79abcf9d203c1b92f29b49aab9005952c3 | [
"MIT"
] | 67 | 2019-06-06T15:03:02.000Z | 2021-12-17T01:51:14.000Z | SRT/lib/datasets/optflow_utils.py | yerang823/landmark-detection | a01bcf79abcf9d203c1b92f29b49aab9005952c3 | [
"MIT"
] | 121 | 2019-06-01T16:37:23.000Z | 2022-03-27T19:20:28.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#
| 35.185185 | 76 | 0.726316 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#
import cv2
def get_optflow_retval(algorithm):
if algorithm.lower() == 'deepflow':
retval = cv2.optflow.createOptF... | 0 | 0 | 0 | 0 | 0 | 716 | 0 | -11 | 45 |
0943ec50d15d9751f0cada78ac17061c04574a8b | 1,142 | py | Python | jskparser/ast/stmt/returnstmt.py | natebragg/java-sketch | f5ac26f2cc46ae4556f9a61c55afd37f55c961ff | [
"MIT"
] | 15 | 2015-12-15T18:33:50.000Z | 2021-09-29T11:48:54.000Z | jskparser/ast/stmt/returnstmt.py | natebragg/java-sketch | f5ac26f2cc46ae4556f9a61c55afd37f55c961ff | [
"MIT"
] | 11 | 2015-11-16T22:14:58.000Z | 2021-09-23T05:28:40.000Z | jskparser/ast/stmt/returnstmt.py | natebragg/java-sketch | f5ac26f2cc46ae4556f9a61c55afd37f55c961ff | [
"MIT"
] | 8 | 2015-11-16T21:50:08.000Z | 2021-03-23T15:15:34.000Z | #!/usr/bin/env python
| 24.297872 | 88 | 0.59282 | #!/usr/bin/env python
from .statement import Statement
from ..expr.nameexpr import NameExpr
from ..expr.literalexpr import LiteralExpr
from ..type.type import Type
from . import _import
class ReturnStmt(Statement):
def __init__(self, kwargs={}):
super(ReturnStmt, self).__init__(kwargs)
locs =... | 0 | 164 | 0 | 667 | 0 | 73 | 0 | 54 | 157 |
d7d215053e155a284da941b003f807461f834711 | 8,669 | py | Python | eval/eval_recognition/eval_ijb.py | yzhHoward/MagFace | 98b56d3a13a06cb9c081cc42a6e8137169af7798 | [
"Apache-2.0"
] | 431 | 2021-03-04T03:17:01.000Z | 2022-03-31T12:59:48.000Z | eval/eval_recognition/eval_ijb.py | yzhHoward/MagFace | 98b56d3a13a06cb9c081cc42a6e8137169af7798 | [
"Apache-2.0"
] | 40 | 2021-03-12T07:56:24.000Z | 2022-03-29T04:27:20.000Z | eval/eval_recognition/eval_ijb.py | yzhHoward/MagFace | 98b56d3a13a06cb9c081cc42a6e8137169af7798 | [
"Apache-2.0"
] | 70 | 2021-03-12T09:10:02.000Z | 2022-03-30T02:32:45.000Z | #!/usr/bin/env python
import argparse
import torch.nn as nn
import torch.utils.data as data
import torch.backends.cudnn as cudnn
# the ijbc dataset is from insightface
# using the cos similarity
# no flip test
# basic args
parser = argparse.ArgumentParser(description='Evaluation')
parser.add_argument('--feat_list',... | 36.120833 | 123 | 0.619218 | #!/usr/bin/env python
import argparse
import os
import cv2
import math
import numpy as np
from tqdm import tqdm
from sklearn.model_selection import KFold
from sklearn import metrics
from scipy.optimize import brentq
from scipy import interpolate
from sklearn.metrics import roc_curve, auc
import torch
import torch.nn ... | 0 | 0 | 0 | 0 | 0 | 6,025 | 0 | 32 | 472 |
b145d80f92580481752a2e1d689188659a644d55 | 8,091 | py | Python | src/flwr_experimental/baseline/run.py | yiliucs/flower | db4d7db353a702b79cbef48b9d4fa5831d91eb00 | [
"Apache-2.0"
] | 1 | 2020-12-29T17:37:12.000Z | 2020-12-29T17:37:12.000Z | src/flwr_experimental/baseline/run.py | yiliucs/flower | db4d7db353a702b79cbef48b9d4fa5831d91eb00 | [
"Apache-2.0"
] | null | null | null | src/flwr_experimental/baseline/run.py | yiliucs/flower | db4d7db353a702b79cbef48b9d4fa5831d91eb00 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.296296 | 88 | 0.642937 | # Copyright 2020 Adap GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
366340617b1c5151be2142533461628bcb242cb4 | 1,121 | py | Python | in_class_examples_part_2/ucr_e-mail_input.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | in_class_examples_part_2/ucr_e-mail_input.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | in_class_examples_part_2/ucr_e-mail_input.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2009-2013 by The Regents of the University of California
# 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 from
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 35.03125 | 74 | 0.742194 | #
# Copyright 2009-2013 by The Regents of the University of California
# 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 from
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
88236ad0c9019c5c1c99d371d7ebf056d477d5a8 | 21,470 | py | Python | feature/5_extract_feature.py | DataXujing/Boutique-Travel-Services-Predict | 8daf77165c7f7a9f7daa895f200515db59ba171e | [
"MIT"
] | 43 | 2018-06-22T07:53:21.000Z | 2021-11-23T03:31:46.000Z | feature/5_extract_feature.py | Bifzivkar/Boutique-Travel-Services-Predict | 8daf77165c7f7a9f7daa895f200515db59ba171e | [
"MIT"
] | null | null | null | feature/5_extract_feature.py | Bifzivkar/Boutique-Travel-Services-Predict | 8daf77165c7f7a9f7daa895f200515db59ba171e | [
"MIT"
] | 15 | 2018-07-22T13:36:02.000Z | 2021-01-09T14:30:15.000Z | # -*- encoding:utf-8 -*-
import pandas as pd
from datetime import datetime
dire = '../../data/'
start = datetime.now()
orderHistory_train = pd.read_csv(dire + 'train/orderHistory_train.csv', encoding='utf-8')
orderFuture_train = pd.read_csv(dire + 'train/orderFuture_train3.csv', encoding='utf-8')
userProfile_train = ... | 47.924107 | 249 | 0.69292 | # -*- encoding:utf-8 -*-
import pandas as pd
import numpy as np
from datetime import datetime
dire = '../../data/'
start = datetime.now()
orderHistory_train = pd.read_csv(dire + 'train/orderHistory_train.csv', encoding='utf-8')
orderFuture_train = pd.read_csv(dire + 'train/orderFuture_train3.csv', encoding='utf-8')
u... | 915 | 0 | 0 | 0 | 0 | 14,978 | 0 | -3 | 308 |
537d5b87b40494c58dc7a9d373d1124e1379f5f0 | 385 | py | Python | timeblock/time.py | w158rk/timeblock | 5b6f6382bb29217127a2387d9efc1655d22fe3a1 | [
"MIT"
] | 1 | 2021-05-03T13:13:12.000Z | 2021-05-03T13:13:12.000Z | timeblock/time.py | w158rk/timeblock | 5b6f6382bb29217127a2387d9efc1655d22fe3a1 | [
"MIT"
] | null | null | null | timeblock/time.py | w158rk/timeblock | 5b6f6382bb29217127a2387d9efc1655d22fe3a1 | [
"MIT"
] | null | null | null | from datetime import datetime
current:datetime = None | 21.388889 | 51 | 0.722078 | from datetime import datetime,timedelta
current:datetime = None
def set_current(d: datetime.date, t:datetime.time):
global current
current = datetime.combine(d, t)
def get_current_date():
return current.date()
def get_current_time():
return current.time()
def inc_current(units: int):
delta = ti... | 0 | 0 | 0 | 0 | 0 | 229 | 0 | 10 | 92 |
166799c5b0bc1df1500ef56cdabafd4e3af994d8 | 3,049 | py | Python | databases.py | Fy-Network/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 1 | 2016-06-17T08:48:52.000Z | 2016-06-17T08:48:52.000Z | databases.py | Fy-/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 1 | 2016-06-17T18:06:41.000Z | 2016-06-17T18:06:41.000Z | databases.py | Fy-Network/fysql | 9a5910601e9aa13479c9fbd05eb64e958e90dea2 | [
"MIT"
] | 2 | 2018-02-11T02:14:11.000Z | 2020-01-07T05:40:34.000Z | # -*- coding: utf-8 -*-
"""
fysql.databases
~~~~~~~~~~~~~~~
:copyright: (c) 2016 by Gasquez Florian
:license: MIT, see LICENSE for more details.
"""
from __future__ import unicode_literals
from .tables import Tables
| 21.935252 | 70 | 0.702525 | # -*- coding: utf-8 -*-
"""
fysql.databases
~~~~~~~~~~~~~~~
:copyright: (c) 2016 by Gasquez Florian
:license: MIT, see LICENSE for more details.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from warnings import filterwarnings
import mysql.connector as mysql_connector
from .excepti... | 0 | 149 | 0 | 2,452 | 0 | 0 | 0 | 70 | 156 |
826249957a3d8af93fc3e00b2ec89ef6f61abd92 | 8,159 | py | Python | Selenium/Opencart_windows_operations/conftest.py | BahrmaLe/otus_python_homework | 510a4f1971b35048d760fcc45098e511b81bea31 | [
"MIT"
] | 1 | 2021-02-25T15:37:21.000Z | 2021-02-25T15:37:21.000Z | Selenium/Opencart_windows_operations/conftest.py | BahrmaLe/otus_python_homework | 510a4f1971b35048d760fcc45098e511b81bea31 | [
"MIT"
] | null | null | null | Selenium/Opencart_windows_operations/conftest.py | BahrmaLe/otus_python_homework | 510a4f1971b35048d760fcc45098e511b81bea31 | [
"MIT"
] | null | null | null | """Fixtures to testing Opencart login page"""
import os
image = os.path.abspath('C:/Users/60064265/PycharmProjects/Homework/Selenium/Opencart_windows_operations/1.JPG')
def pytest_addoption(parser):
"""Setting base URL Openacart and parametrize command line options for select
browsers and set username or pas... | 42.717277 | 118 | 0.697022 | """Fixtures to testing Opencart login page"""
import os
import sys
import pytest
from selenium import webdriver as WD
from Selenium.Opencart_windows_operations.models.page_objects.page_objects import LoginPage, \
ProductPage, ProductsPage, ProductManager, DownloadPage, DownloadManager, CustomMenuDesignPage, Custom... | 0 | 5,194 | 0 | 0 | 0 | 0 | 0 | 188 | 503 |
051e4d78d4085682cbb0206e37e6ac2c0da1a589 | 1,646 | py | Python | cynpy/i2c.py | rayjhuang/cynpy | 1bf4476691f561322f6b2bfb5b2bef36f2e5e04b | [
"MIT"
] | null | null | null | cynpy/i2c.py | rayjhuang/cynpy | 1bf4476691f561322f6b2bfb5b2bef36f2e5e04b | [
"MIT"
] | null | null | null | cynpy/i2c.py | rayjhuang/cynpy | 1bf4476691f561322f6b2bfb5b2bef36f2e5e04b | [
"MIT"
] | null | null | null |
TRUE = 1 # ACK, YES
FALSE = 0 # NAK, NO
def choose_master (rpt=FALSE):
'''
TO CONSIDER FOLLOWING SCENARIOS
-------------------------------
1. use AARDARK in a non-Windows system
'''
from aardv import aardvark_i2c as aa_i2c
num = aa_i2c().enum (rpt)
return aa_i2c(0) # i2cmst
if __... | 27.433333 | 123 | 0.53706 |
TRUE = 1 # ACK, YES
FALSE = 0 # NAK, NO
class i2c (object): # for polymorphism
'''
i2c class hierarchy
-------------------
i2c
\
aardvark_i2c
/ (aardv.py)
aardvark
'''
def enum (me): raise NotImplementedError()
def baud (me, ask): rai... | 0 | 0 | 0 | 742 | 0 | 0 | 0 | -2 | 50 |
622d3cc99f73955ecb3d5b33a08bb2260c6a5623 | 1,465 | py | Python | Calibration - Nozzle Response/callibrate_servo_tringle.py | technosap/FlyVR_TL_2E343 | bd21acf22cca8403b93862ccbcc348750f997923 | [
"MIT"
] | null | null | null | Calibration - Nozzle Response/callibrate_servo_tringle.py | technosap/FlyVR_TL_2E343 | bd21acf22cca8403b93862ccbcc348750f997923 | [
"MIT"
] | null | null | null | Calibration - Nozzle Response/callibrate_servo_tringle.py | technosap/FlyVR_TL_2E343 | bd21acf22cca8403b93862ccbcc348750f997923 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 4 16:35:53 2019
@author: technosap
"""
if __name__ == "__main__":
main()
| 29.897959 | 112 | 0.470307 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 4 16:35:53 2019
@author: technosap
"""
import ctypes
import time
import math
from modular_client import ModularClient # for nozzle control
def main():
dev = ModularClient(port='COM10') # Windows specific port
# dev.get_device_id()
# dev.get_methods()
de... | 0 | 0 | 0 | 0 | 0 | 1,212 | 0 | -9 | 133 |
c7e316a6cc5964fa9b30106676cb6a6534f08812 | 5,430 | py | Python | wikitablescrape.py | feedthebeat90/topos-challenge | 56842be8ffb33bed428762cc06f002f983457a4d | [
"MIT"
] | null | null | null | wikitablescrape.py | feedthebeat90/topos-challenge | 56842be8ffb33bed428762cc06f002f983457a4d | [
"MIT"
] | 1 | 2021-03-31T19:17:31.000Z | 2021-03-31T19:17:31.000Z | wikitablescrape.py | feedthebeat90/topos-challenge | 56842be8ffb33bed428762cc06f002f983457a4d | [
"MIT"
] | null | null | null | """Create CSVs from all tables on a Wikipedia article."""
import csv
import os
from bs4 import BeautifulSoup
import requests
def scrape(url, output_name):
"""Create CSVs from all tables in a Wikipedia article.
ARGS:
url (str): The full URL of the Wikipedia article to scrape tables from.
outp... | 32.710843 | 87 | 0.588214 | """Create CSVs from all tables on a Wikipedia article."""
import csv
import os
from bs4 import BeautifulSoup
import requests
from pprint import pprint
def scrape(url, output_name):
"""Create CSVs from all tables in a Wikipedia article.
ARGS:
url (str): The full URL of the Wikipedia article to scrape... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
84324bd99a44d53d1f1b47653ba819853cafe98f | 5,235 | py | Python | Pyrlang/gen.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | Pyrlang/gen.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | Pyrlang/gen.py | s2hc-johan/Pyrlang | cd77f44b06677d313b241078282e4cb2bd7bd7a1 | [
"Apache-2.0"
] | null | null | null | """ A helper module to assist with gen:call-style message parsing and replying.
A generic incoming message looks like ``{$gen_call, {From, Ref}, Message}``.
"""
from Pyrlang import Term
def parse_gen_call(msg):
""" Determine if msg is a gen:call message
:param msg: An Erlang tuple hopefully start... | 35.856164 | 80 | 0.600191 | """ A helper module to assist with gen:call-style message parsing and replying.
A generic incoming message looks like ``{$gen_call, {From, Ref}, Message}``.
"""
from Pyrlang import Term
class GenBase:
""" Base class for Gen messages, do not use directly. See
``GenIncomingMessage`` and ``GenIncomingCa... | 0 | 0 | 0 | 2,618 | 0 | 0 | 0 | 0 | 69 |
8f463170aadd58297b706c73c8ba914d8390c5e9 | 14,908 | py | Python | src/sage/geometry/relative_interior.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/geometry/relative_interior.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/geometry/relative_interior.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | r"""
Relative Interiors of Polyhedra and Cones
"""
# ****************************************************************************
# Copyright (C) 2021 Matthias Koeppe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | 34.429561 | 110 | 0.567749 | r"""
Relative Interiors of Polyhedra and Cones
"""
# ****************************************************************************
# Copyright (C) 2021 Matthias Koeppe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# ... | 0 | 0 | 0 | 14,268 | 0 | 0 | 0 | 41 | 46 |
961c9747018bcc3a766268b8fdc55badf884779e | 17,022 | py | Python | custom_components/lennoxs30/config_flow.py | PeteRager/LennoxS30 | 5579c0f1e1a369c5c68b65d30f5bf30851442dee | [
"MIT"
] | 28 | 2021-06-04T15:57:37.000Z | 2022-03-28T22:59:58.000Z | custom_components/lennoxs30/config_flow.py | PeteRager/LennoxS30 | 5579c0f1e1a369c5c68b65d30f5bf30851442dee | [
"MIT"
] | 97 | 2021-06-04T22:23:18.000Z | 2022-03-31T14:54:18.000Z | custom_components/lennoxs30/config_flow.py | PeteRager/LennoxS30 | 5579c0f1e1a369c5c68b65d30f5bf30851442dee | [
"MIT"
] | 8 | 2021-07-22T20:48:00.000Z | 2021-11-03T12:02:51.000Z | import ipaddress
import re
import voluptuous as vol
from .const import (CONF_ALLERGEN_DEFENDER_SWITCH, CONF_APP_ID, CONF_CLOUD_CONNECTION, CONF_CREATE_INVERTER_POWER, CONF_CREATE_SENSORS, LENNOX_DEFAULT_CLOUD_APP_ID, LENNOX_DEFAULT_LOCAL_APP_ID, CONF_LOCAL_CONNECTION)
from homeassistant.const import (CONF_HOST, CONF_E... | 40.918269 | 147 | 0.567148 | import ipaddress
import re
from lennoxs30api.s30exception import EC_AUTHENTICATE, EC_LOGIN, S30Exception
import voluptuous as vol
from . import Manager
from .const import (
CONF_ALLERGEN_DEFENDER_SWITCH,
CONF_APP_ID,
CONF_CLOUD_CONNECTION,
CONF_CREATE_INVERTER_POWER,
CONF_CREATE_SENSORS,
CONF_F... | 0 | 285 | 12,155 | 1,923 | 0 | 0 | 0 | 422 | 201 |
43fc0efa71086d127093049d027710be2c64639e | 10,918 | py | Python | visualisation/generation/electricity_generation_plot.py | HauHe/OSeMBEtoREEEMdb | 4ce4cb814ecd9d65b937af51f807f0b0fd88828a | [
"Apache-2.0",
"CC-BY-4.0"
] | 2 | 2021-01-07T15:27:18.000Z | 2022-02-12T21:21:04.000Z | visualisation/generation/electricity_generation_plot.py | HauHe/OSeMBEtoREEEMdb | 4ce4cb814ecd9d65b937af51f807f0b0fd88828a | [
"Apache-2.0",
"CC-BY-4.0"
] | 7 | 2019-07-23T15:16:09.000Z | 2022-02-15T10:47:57.000Z | visualisation/generation/electricity_generation_plot.py | HauHe/OSeMBEtoREEEMdb | 4ce4cb814ecd9d65b937af51f807f0b0fd88828a | [
"Apache-2.0",
"CC-BY-4.0"
] | 3 | 2021-06-08T13:06:45.000Z | 2022-03-23T14:39:07.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 25 14:51:38 2020
@author: haukeh
"""
#%%Import of required packages
import sys
#%% Function to read results csv files
#%% Function to create dictionaries containing dictionaries for each scenario that contain the results as dataframes
#%% Function to creat a df with the... | 41.356061 | 503 | 0.588111 | # -*- coding: utf-8 -*-
"""
Created on Fri Sep 25 14:51:38 2020
@author: haukeh
"""
#%%Import of required packages
import numpy as np
import pandas as pd
import os
import sys
import plotly.graph_objs as go
from plotly.offline import plot
#%% Function to read results csv files
def read_csv(scen, param):
df = pd.r... | 0 | 0 | 0 | 0 | 0 | 8,772 | 0 | 2 | 308 |
554f324cd1b73fb5ea839a27518cc3cd2a409d84 | 606 | py | Python | scripts/model_summary.py | Dmitriuso/longformer | ff8c00bb672585d7f3a10f4a85c24e12a39c29e8 | [
"Apache-2.0"
] | null | null | null | scripts/model_summary.py | Dmitriuso/longformer | ff8c00bb672585d7f3a10f4a85c24e12a39c29e8 | [
"Apache-2.0"
] | null | null | null | scripts/model_summary.py | Dmitriuso/longformer | ff8c00bb672585d7f3a10f4a85c24e12a39c29e8 | [
"Apache-2.0"
] | null | null | null | #from pytorch_lightning import LightingModule
from transformers import AutoModelForSeq2SeqLM
PATH = "../longformer/models/LongTinyMBART"
model = AutoModelForSeq2SeqLM.from_pretrained(PATH)
# model_torch = torch.load(PATH)
# model = model_torch
# model_lightning = MyLightingModule.load_from_checkpoint(PATH)
# model... | 25.25 | 77 | 0.754125 | import torch
#from pytorch_lightning import LightingModule
from transformers import AutoModelForSeq2SeqLM, MBartForConditionalGeneration
PATH = "../longformer/models/LongTinyMBART"
model = AutoModelForSeq2SeqLM.from_pretrained(PATH)
# model_torch = torch.load(PATH)
# model = model_torch
# model_lightning = MyLight... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 22 |
11d5d4498d9e4821020710b9442598427cfb7f13 | 3,851 | py | Python | pyke/tests/test_kepconvert.py | ecalifornica/pyke | 6a3fcc0513cf012044e4420cc4d17064e582d142 | [
"MIT"
] | null | null | null | pyke/tests/test_kepconvert.py | ecalifornica/pyke | 6a3fcc0513cf012044e4420cc4d17064e582d142 | [
"MIT"
] | 1 | 2017-07-25T19:23:05.000Z | 2017-07-25T19:23:05.000Z | pyke/tests/test_kepconvert.py | mirca/PyKE | 6a3fcc0513cf012044e4420cc4d17064e582d142 | [
"MIT"
] | null | null | null | from astropy.utils.data import get_pkg_data_filename
fake_lc = get_pkg_data_filename("data/golden-lc.fits")
SUPPORTED_CONVERSION = ['jd', 'mjd', 'decimalyear', 'unix', 'cxcsec', 'gps',
'plot_date', 'datetime', 'iso', 'isot', 'yday', 'fits',
'byear', 'jyear', 'byear_str'... | 44.264368 | 79 | 0.572579 | import pytest
import csv
from astropy.utils.data import get_pkg_data_filename
from astropy.io import fits as pyfits
from astropy.time import Time as astropyTime
from pyke import kepconvert
from pyke import kepio
from ..kepio import delete
fake_lc = get_pkg_data_filename("data/golden-lc.fits")
def test_kepconvert():
... | 0 | 0 | 0 | 0 | 0 | 3,284 | 0 | 32 | 200 |
21f03fec975e47ecea6661210575c239ff1b02f1 | 8,077 | py | Python | demo.py | hukim1112/weakalign | 4d2c5a275fd50f34418734198b32de3c8ce749a8 | [
"MIT"
] | null | null | null | demo.py | hukim1112/weakalign | 4d2c5a275fd50f34418734198b32de3c8ce749a8 | [
"MIT"
] | null | null | null | demo.py | hukim1112/weakalign | 4d2c5a275fd50f34418734198b32de3c8ce749a8 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import os
import argparse
import torch
import torch.nn as nn
from os.path import exists
from torch.utils.data import DataLoader
from model.cnn_geometric_model import TwoStageCNNGeometric
from data.pf_dataset import PFPascalDataset
from image.normalization import Normalize... | 42.73545 | 146 | 0.710288 | from __future__ import print_function, division
import os
import argparse
import torch
import torch.nn as nn
from os.path import exists
from torch.utils.data import Dataset, DataLoader
from model.cnn_geometric_model import CNNGeometric, TwoStageCNNGeometric
from data.pf_dataset import PFDataset, PFPascalDataset
from da... | 0 | 0 | 0 | 0 | 0 | 763 | 0 | 98 | 88 |
71a21e4a40918501a27b23e93ce27aedb909ef4f | 890 | py | Python | tests/backend/tarantool/test_schema.py | liviu-lesan/planetmint | 54cf8e45108947aa8282ddaaf127d08e06ce842e | [
"Apache-2.0"
] | null | null | null | tests/backend/tarantool/test_schema.py | liviu-lesan/planetmint | 54cf8e45108947aa8282ddaaf127d08e06ce842e | [
"Apache-2.0"
] | null | null | null | tests/backend/tarantool/test_schema.py | liviu-lesan/planetmint | 54cf8e45108947aa8282ddaaf127d08e06ce842e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Interplanetary Database Association e.V.,
# Planetmint and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
| 28.709677 | 102 | 0.720225 | # Copyright © 2020 Interplanetary Database Association e.V.,
# Planetmint and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
from planetmint.backend.tarantool.connection import TarantoolDB
def _check_spaces_by_list(conn, space_names):
... | 2 | 0 | 0 | 0 | 0 | 548 | 0 | 42 | 92 |